Skip to content

Commit

Permalink
Merge pull request #119 from GoogleChromeLabs/add-desc
Browse files Browse the repository at this point in the history
Add `description` key into `Filter` and info icon to show description
  • Loading branch information
Sayed Taqui authored Aug 21, 2023
2 parents bf5f523 + c65f035 commit d4cad97
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import React, { useState } from 'react';
/**
* Internal dependencies.
*/
// eslint-disable-next-line import/no-relative-packages
import { ArrowDown } from '../../../../../../icons';
import { ArrowDown, InfoIcon } from '../../../../../../icons';
import SubList from './subList';
import type {
SelectedFilters,
Expand Down Expand Up @@ -80,16 +79,23 @@ const ListItem: React.FC<ListItemProps> = ({

return (
<li className="py-[3px]">
<a
href="#"
className="flex items-center text-asteriod-black dark:text-bright-gray"
onClick={toggleSubList}
>
<span className={showSubList ? '' : '-rotate-90'}>
<ArrowDown />
</span>
<p className="ml-1 leading-normal font-semi-thick">{filter.name}</p>
</a>
<div className="flex gap-2 items-center">
<a
href="#"
className="flex items-center text-asteriod-black dark:text-bright-gray"
onClick={toggleSubList}
>
<span className={showSubList ? '' : '-rotate-90'}>
<ArrowDown />
</span>
<p className="ml-1 leading-normal font-semi-thick">{filter.name}</p>
</a>
{filter.description && (
<p title={filter.description}>
<InfoIcon />
</p>
)}
</div>
{showSubList && (
<>
<SubList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export const FILTER_MAPPING = [
keys: 'isCookieSet',
type: 'boolean',
order: 10,
description:
"Whether the cookie was accepted(set) in Chrome's Cookie Store",
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ export interface Filter {
default?: string;
sort?: boolean;
order: number;
description?: string;
}

0 comments on commit d4cad97

Please sign in to comment.