Skip to content

Commit 6a606a9

Browse files
authored
Merge pull request #1503 from NSTKrishna/feat/add-category-icon
Add CategoryIcon component and exports
2 parents e1201eb + 8390cdf commit 6a606a9

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { FC } from 'react';
2+
import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
3+
import { CARIBBEAN_GREEN, DARK_SLATE_GRAY, KEPPEL, useTheme } from '../../theme';
4+
import { CustomIconProps } from '../types';
5+
6+
export const CategoryIcon: FC<CustomIconProps> = ({
7+
width = DEFAULT_WIDTH,
8+
height = DEFAULT_HEIGHT,
9+
primaryFill,
10+
secondaryFill,
11+
style = {},
12+
...props
13+
}) => {
14+
const theme = useTheme();
15+
const themeMode = theme?.palette?.mode ?? 'light';
16+
const themePrimaryFill = primaryFill ?? (themeMode === 'dark' ? KEPPEL : DARK_SLATE_GRAY);
17+
const themeSecondaryFill = secondaryFill ?? (themeMode === 'dark' ? CARIBBEAN_GREEN : KEPPEL);
18+
19+
return (
20+
<svg
21+
width={width}
22+
height={height}
23+
xmlns="http://www.w3.org/2000/svg"
24+
viewBox="0 0 24 24"
25+
style={style}
26+
{...props}
27+
>
28+
<path d="m12 2-5.5 9h11z" fill={themeSecondaryFill} />
29+
<path
30+
d="M17.5 13c-2.49 0-4.5 2.01-4.5 4.5s2.01 4.5 4.5 4.5 4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5z"
31+
fill={themePrimaryFill}
32+
/>
33+
<path d="M3 13h8v8H3z" fill={themePrimaryFill} />
34+
</svg>
35+
);
36+
};

src/icons/CategoryIcon/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as CategoryIcon } from './CategoryIcon';

src/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export * from './Calender';
2222
export * from './Cancel';
2323
export * from './CaretDown';
2424
export * from './CatalogIcon';
25+
export * from './CategoryIcon';
2526
export * from './Chain';
2627
export * from './Challenges';
2728
export * from './Chat';

0 commit comments

Comments
 (0)