Skip to content

Commit e03c627

Browse files
Feat/hub (#1154)
Co-authored-by: dasein <[email protected]>
1 parent 7e9ac11 commit e03c627

File tree

57 files changed

+1122
-694
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1122
-694
lines changed

src/components/Dot/Dot.module.scss

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
$animation-time: 2.3s;
2+
3+
.dot {
4+
--size: 4px;
5+
6+
display: inline-block;
7+
border-radius: 50%;
8+
opacity: 1;
9+
position: relative;
10+
11+
width: var(--size);
12+
height: var(--size);
13+
14+
--color-r: 0;
15+
--color-b: 0;
16+
--color-g: 0;
17+
18+
&.color_ {
19+
&blue {
20+
--color-r: 31;
21+
--color-b: 203;
22+
--color-g: 225;
23+
}
24+
25+
&red {
26+
--color-r: 255;
27+
--color-b: 92;
28+
--color-g: 0;
29+
}
30+
31+
&green {
32+
--color-r: 122;
33+
--color-b: 250;
34+
--color-g: 161;
35+
}
36+
37+
&purple {
38+
--color-r: 246;
39+
--color-b: 43;
40+
--color-g: 253;
41+
}
42+
43+
&yellow {
44+
--color-r: 255;
45+
--color-g: 0;
46+
--color-b: 217;
47+
}
48+
}
49+
50+
background-color: rgb(var(--color-r), var(--color-b), var(--color-g));
51+
}
52+
53+
.animation {
54+
transition: all 1s;
55+
56+
animation: pulse $animation-time infinite alternate;
57+
}
58+
59+
@keyframes pulse {
60+
0% {
61+
box-shadow: 0px 0px 0px 0px rgb(var(--color-r),
62+
var(--color-b),
63+
var(--color-g));
64+
opacity: 0.2;
65+
}
66+
67+
100% {
68+
box-shadow: 0px 0px 10px 2px rgb(var(--color-r), var(--color-b), var(--color-g));
69+
}
70+
}

src/components/Dot/Dot.stories.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Meta, StoryObj } from '@storybook/react';
2+
import Dot from './Dot';
3+
4+
const meta: Meta<typeof Dot> = {
5+
component: Dot,
6+
title: 'atoms/Dot',
7+
parameters: {
8+
design: {
9+
type: 'figma',
10+
url: '',
11+
},
12+
},
13+
};
14+
export default meta;
15+
16+
type Story = StoryObj<typeof Dot>;
17+
18+
export const Main: Story = {
19+
args: {
20+
color: 'green',
21+
animation: true,
22+
},
23+
};

src/components/Dot/Dot.tsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import cx from 'classnames';
2+
import { useEffect, useRef } from 'react';
3+
import styles from './Dot.module.scss';
4+
5+
export enum DotColors {
6+
blue = 'blue',
7+
green = 'green',
8+
red = 'red',
9+
purple = 'purple',
10+
yellow = 'yellow',
11+
}
12+
13+
type Props = {
14+
color: DotColors | keyof typeof DotColors;
15+
className?: string;
16+
animation?: boolean;
17+
size?: number;
18+
};
19+
20+
function Dot({ color, className, animation, size = 4 }: Props) {
21+
const ref = useRef<HTMLLabelElement | null>(null);
22+
23+
useEffect(() => {
24+
if (ref.current) {
25+
ref.current.style.setProperty('--size', `${size}px`);
26+
}
27+
}, [ref, size]);
28+
29+
return (
30+
<span
31+
ref={ref}
32+
className={cx(styles.dot, styles[`color_${color}`], className, {
33+
[styles.animation]: animation,
34+
})}
35+
/>
36+
);
37+
}
38+
39+
export default Dot;

src/components/Row/Row.module.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
.container {
22
display: grid;
33
grid-template-columns: 240px 1fr;
4-
align-items: center;
4+
align-items: baseline;
55
line-height: 20px;
66
font-size: 16px;
77

88
.value {
99
text-transform: none !important;
1010
display: flex;
11-
align-items: center;
12-
justify-content: flex-start;
11+
justify-content: center;
12+
align-items: flex-start;
13+
flex-direction: column;
1314
}
1415
}
1516

src/components/actionBar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function ActionBar({ children, text, onClickBack, button }: Props) {
6262
const noPassport = CHAIN_ID === Networks.BOSTROM && !passport;
6363

6464
const exception =
65-
(location.pathname !== routes.keys.path &&
65+
(!location.pathname.includes('/keys') &&
6666
!location.pathname.includes('/drive') &&
6767
// !location.pathname.includes('/oracle') &&
6868
location.pathname !== '/') ||

src/components/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ import Slider from './Slider/Slider';
5555
import CreatedAt from './CreatedAt/CreatedAt';
5656
import Tabs from './Tabs/Tabs';
5757
import Row, { RowsContainer } from './Row/Row';
58+
import Display from './containerGradient/Display/Display';
59+
import DisplayTitle from './containerGradient/DisplayTitle/DisplayTitle';
60+
import { Color } from './LinearGradientContainer/LinearGradientContainer';
61+
import Dot from './Dot/Dot';
5862

5963
const BtnGrd = Button;
6064

@@ -108,6 +112,10 @@ export {
108112
Tabs,
109113
Row,
110114
RowsContainer,
115+
Display,
116+
DisplayTitle,
117+
Color,
118+
Dot,
111119
};
112120

113121
export { Dots } from './ui/Dots';

src/components/search/Spark/LeftMeta/Creator/Creator.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Account from 'src/components/account/account';
66
import { timeSince } from 'src/utils/utils';
77
import styles from './Creator.module.scss';
88

9-
function Creator({ cid }: { cid: string }) {
9+
function Creator({ cid, onlyTime }: { cid: string; onlyTime?: boolean }) {
1010
const { creator } = useGetCreator(cid);
1111

1212
if (!creator) {
@@ -24,7 +24,7 @@ function Creator({ cid }: { cid: string }) {
2424
</span>
2525
</Tooltip>
2626

27-
<Account address={creator.address} avatar />
27+
{!onlyTime && <Account address={creator.address} avatar />}
2828
</>
2929
);
3030
}

src/components/search/Spark/Spark.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ import RankButton from './LeftMeta/RankButton/RankButton';
1414
type Props = {
1515
cid: string;
1616
handleContentType: (type: IpfsContentType) => void;
17-
handleRankClick: (cid: string) => void;
17+
handleRankClick?: (cid: string) => void;
1818
itemData: {};
1919
query: string;
2020
linkType: LinksType;
21+
selfLinks?: boolean;
2122
};
2223

2324
function Spark({
@@ -28,6 +29,7 @@ function Spark({
2829
rankSelected,
2930
handleContentType,
3031
handleRankClick,
32+
selfLinks,
3133
}: Props) {
3234
const { isMobile } = useDevice();
3335
const [ref, hovering] = useHover();
@@ -37,12 +39,14 @@ function Spark({
3739
{!isMobile && hovering && (
3840
<>
3941
<div className={styles.left}>
40-
<Creator cid={cid} />
41-
<RankButton
42-
cid={cid}
43-
rankSelected={rankSelected}
44-
handleRankClick={handleRankClick}
45-
/>
42+
<Creator cid={cid} onlyTime={selfLinks} />
43+
{handleRankClick && (
44+
<RankButton
45+
cid={cid}
46+
rankSelected={rankSelected}
47+
handleRankClick={handleRankClick}
48+
/>
49+
)}
4650
</div>
4751

4852
{/* TODO: refact. meta should be moved inside contentItem and exclude fetchParticle from that */}

src/components/valueImg/imgDenom.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ function ImgDenom({
101101
setTooltipText(path);
102102
}
103103
} else {
104-
setImgDenom(defaultImg);
104+
setImgDenom(getNativeImg(coinDenom));
105105
}
106-
}, [coinDenom, infoDenom, fetchWithDetails]);
106+
}, [coinDenom, infoDenom, fetchWithDetails, getImgFromIpfsByCid]);
107107

108108
const img = (
109109
<img

src/constants/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,6 @@ export const DIVISOR_CYBER_G = 10 ** 9;
4444

4545
export const DEFAULT_GAS_LIMITS = 200000;
4646

47+
export const COIN_DECIMALS_RESOURCE = 3;
48+
4749
export const { MEMO_KEPLR } = defaultNetworks[DEFAULT_CHAIN_ID];

0 commit comments

Comments
 (0)