Skip to content

Commit 78a4a92

Browse files
feat(icons): enhance HBRIcon and add new product icons
- Updated HBRIcon component to accept a color prop for dynamic coloring. - Added KosmosProductIcon and StakeProductIcon to the actions index for better modularity. - Refactored PRODUCTS to utilize new icons and adjusted scales for improved UI consistency.
1 parent 2b7d6e6 commit 78a4a92

File tree

5 files changed

+62
-10
lines changed

5 files changed

+62
-10
lines changed

src/components/svg/icons/TokenHBR.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import React from 'react';
22
import { Path, Svg } from 'react-native-svg';
33
import { IconProps } from './Icon.types';
44

5-
export function HBRIcon({ scale = 1 }: IconProps) {
5+
export function HBRIcon({ scale = 1, color = '#FFC93E' }: IconProps) {
66
const size = 29 * scale;
77
return (
88
<Svg width={size} height={size} viewBox="0 0 32 33" fill="none">
99
<Path
1010
fillRule="evenodd"
1111
clipRule="evenodd"
1212
d="M2 16.6958C2 9.68803 6.93003 3.84256 13.4802 2.50022V7.10895C9.79249 8.23249 7.01095 11.4646 6.51161 15.4164H10.94C11.5733 13.0201 13.7561 11.2536 16.3514 11.2536C18.9467 11.2536 21.1295 13.0201 21.7628 15.4164H26.1903C25.6909 11.4642 22.9089 8.23187 19.2206 7.10862V2.5C25.7713 3.84192 30.7019 9.68765 30.7019 16.6958C30.7019 24.6958 24.2768 31.1812 16.351 31.1812C8.42514 31.1812 2 24.6958 2 16.6958ZM26.146 18.2866L21.7623 18.2866C21.2496 20.2235 19.7245 21.7487 17.7876 22.2614V26.604C22.0696 25.977 25.4655 22.589 26.146 18.2866ZM14.9174 26.6045V22.262C12.9794 21.7498 11.4534 20.2242 10.9405 18.2866L6.5559 18.2866C7.23656 22.59 10.6339 25.9786 14.9174 26.6045Z"
13-
fill="#FFC93E"
13+
fill={color}
1414
/>
1515
</Svg>
1616
);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react';
2+
import { Circle, Path, Svg } from 'react-native-svg';
3+
import { COLORS } from '@constants/colors';
4+
import { IconProps } from '../../Icon.types';
5+
6+
export function KosmosProductIcon({
7+
scale = 1,
8+
color = COLORS.neutral0
9+
}: IconProps) {
10+
const size = 24;
11+
const scaled = size * scale;
12+
13+
return (
14+
<Svg width={scaled} height={scaled} fill="none" viewBox="0 0 60 60">
15+
<Path
16+
fill={color}
17+
fillRule="evenodd"
18+
d="M58.194 19.718c-3.442-6.043-9.941-10.117-17.392-10.117-11.047 0-20.001 8.954-20.001 20 0 11.047 8.954 20.001 20 20.001 7.976 0 14.86-4.668 18.073-11.42-3.561 12.593-15.14 21.82-28.873 21.82C13.432 60.003 0 46.572 0 30.002S13.432 0 30.001 0c12.957 0 23.995 8.214 28.193 19.718"
19+
clipRule="evenodd"
20+
></Path>
21+
<Circle cx="50.217" cy="29.348" r="9.783" fill="#fff"></Circle>
22+
</Svg>
23+
);
24+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import { Circle, Path, Svg } from 'react-native-svg';
3+
import { COLORS } from '@constants/colors';
4+
import { IconProps } from '../../Icon.types';
5+
6+
export function StakeProductIcon({ scale = 1 }: IconProps) {
7+
const size = 24;
8+
const scaled = size * scale;
9+
10+
return (
11+
<Svg width={scaled} height={scaled} fill="none" viewBox="0 0 60 60">
12+
<Circle cx="30.004" cy="30.001" r="24" fill="#fff"></Circle>
13+
<Circle cx="30" cy="30" r="29.5" stroke="#fff"></Circle>
14+
<Path
15+
fill={COLORS.brand600}
16+
fillRule="evenodd"
17+
d="M22.149 45.074a.43.43 0 0 1-.58-.126l-.495-.728a.437.437 0 0 1 .096-.59 19.1 19.1 0 0 0 4.014-4.242c3.915-5.72 3.915-12.919 0-18.639a19.1 19.1 0 0 0-4.014-4.243.437.437 0 0 1-.096-.589l.494-.728a.43.43 0 0 1 .58-.126l21.934 13.37a1.915 1.915 0 0 1 0 3.27z"
18+
clipRule="evenodd"
19+
></Path>
20+
</Svg>
21+
);
22+
}

src/components/svg/icons/v2/actions/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ export { SwapAccountActionIcon } from './SwapAccountAction';
33
export { StakeAccountActionIcon } from './StakeAccountAction';
44
export { BridgeAccountActionIcon } from './BridgeAccountAction';
55
export { KosmosAccountActionIcon } from './KosmosAccountAction';
6+
export { KosmosProductIcon } from './KosmosProduct';
7+
export { StakeProductIcon } from './StakeProduct';

src/features/products/entities/_products.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import React from 'react';
22
import { TFunction } from 'i18next';
3+
import { HBRIcon } from '@components/svg/icons';
34
import {
45
BridgeAccountActionIcon,
6+
KosmosProductIcon,
7+
StakeProductIcon,
58
SwapAccountActionIcon
69
} from '@components/svg/icons/v2/actions';
7-
import { HarborAccountAction } from '@components/svg/icons/v2/harbor';
10+
import { COLORS } from '@constants/colors';
811
import { CustomAppEvents } from '@lib/firebaseEventAnalytics';
912
import { SectionizedProducts } from '../utils';
1013

@@ -18,7 +21,7 @@ export const PRODUCTS = (t: TFunction<string>): SectionizedProducts[] => {
1821
name: t('token.actions.swap'),
1922
description: t('products.swap.description'),
2023
icon: (
21-
<SwapAccountActionIcon scale={2} color="rgba(166, 129, 239, 1)" />
24+
<SwapAccountActionIcon scale={2.5} color="rgba(166, 129, 239, 1)" />
2225
),
2326
background: ['rgba(132, 224, 255, 0.2)', 'rgba(160, 99, 221, 0.2)'],
2427
color: 'rgba(52, 27, 104, 1)',
@@ -30,7 +33,10 @@ export const PRODUCTS = (t: TFunction<string>): SectionizedProducts[] => {
3033
name: t('account.actions.bridge'),
3134
description: t('products.bridge.description'),
3235
icon: (
33-
<BridgeAccountActionIcon scale={2} color="rgba(255, 152, 99, 1)" />
36+
<BridgeAccountActionIcon
37+
scale={2.5}
38+
color="rgba(255, 152, 99, 1)"
39+
/>
3440
),
3541
background: ['rgba(164, 128, 235, 0.2)', 'rgba(210, 95, 95, 0.2)'],
3642
color: 'rgba(118, 43, 6, 1)',
@@ -46,9 +52,7 @@ export const PRODUCTS = (t: TFunction<string>): SectionizedProducts[] => {
4652
id: 2,
4753
name: t('account.actions.stake'),
4854
description: t('products.stake.description'),
49-
icon: (
50-
<SwapAccountActionIcon scale={2} color="rgba(255, 255, 255, 1)" />
51-
),
55+
icon: <StakeProductIcon scale={2.5} color="rgba(255, 255, 255, 1)" />,
5256
background: ['rgba(53, 104, 221, 1)', 'rgba(33, 65, 140, 1)'],
5357
color: 'rgba(255, 255, 255, 1)',
5458
route: 'StakingPools',
@@ -59,7 +63,7 @@ export const PRODUCTS = (t: TFunction<string>): SectionizedProducts[] => {
5963
name: 'KOSMOS',
6064
description: t('products.kosmos.description'),
6165
icon: (
62-
<SwapAccountActionIcon scale={2} color="rgba(255, 255, 255, 1)" />
66+
<KosmosProductIcon scale={2.5} color="rgba(255, 255, 255, 1)" />
6367
),
6468
background: ['rgba(67, 68, 145, 1)', 'rgba(51, 48, 96, 1)'],
6569
color: 'rgba(255, 255, 255, 1)',
@@ -70,7 +74,7 @@ export const PRODUCTS = (t: TFunction<string>): SectionizedProducts[] => {
7074
id: 4,
7175
name: 'HARBOR',
7276
description: t('products.harbor.description'),
73-
icon: <HarborAccountAction scale={1} />,
77+
icon: <HBRIcon scale={2.35} color={COLORS.neutral0} />,
7478
background: ['rgba(255, 201, 62, 1)', 'rgba(224, 131, 0, 1)'],
7579
color: 'rgba(255, 255, 255, 1)',
7680
route: 'Harbor',

0 commit comments

Comments
 (0)