Skip to content

Commit 05e0c1d

Browse files
committed
Merge branch 'dev' into feat/graph-cid-resolving
2 parents dd746fe + 7add72d commit 05e0c1d

File tree

61 files changed

+721
-462
lines changed

Some content is hidden

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

61 files changed

+721
-462
lines changed

public/images/cyb-map.png

244 KB
Loading

src/components/HydrogenBalance/HydrogenBalance.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import { useGetBalanceBostrom } from 'src/containers/sigma/hooks';
2-
import SideButtonLink from '../sideButtonLink/SideButtonLink';
3-
import { routes } from 'src/routes';
42
import IconsNumber from '../IconsNumber/IconsNumber';
53

6-
function HydrogenBalance({ address, isVertical }) {
4+
type Props = {
5+
address?: string;
6+
isVertical?: boolean;
7+
};
8+
9+
function HydrogenBalance({ address, isVertical }: Props) {
710
const { totalAmountInLiquid } = useGetBalanceBostrom(address);
811

912
return (
10-
<SideButtonLink
11-
to={`${routes.neuron.getLink(address)}/sigma`}
12-
buttonType="hydrogen"
13-
>
13+
<span>
1414
<IconsNumber
1515
value={totalAmountInLiquid.currentCap}
1616
type="hydrogen"
1717
isVertical={isVertical}
1818
/>
19-
</SideButtonLink>
19+
</span>
2020
);
2121
}
2222

src/components/actionBar/styles.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
justify-content: center;
55
width: 100%;
66
position: fixed;
7-
bottom: 20px;
7+
bottom: 0px;
88
left: 0;
99
padding: 10px 0;
1010
background: linear-gradient(0deg,

src/components/appMenu/CircularMenu.module.scss

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/components/appMenu/CircularMenu.tsx

Lines changed: 0 additions & 100 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.circle {
2+
position: fixed;
3+
bottom: 0px;
4+
width: 220px;
5+
height: 220px;
6+
display: inline-flex;
7+
border-radius: 50%;
8+
z-index: 4;
9+
pointer-events: none;
10+
}
11+
12+
.menu {
13+
--diameter: 140px;
14+
--i: 23deg; //elements angle
15+
--delta: 0deg; //second menu layer angle
16+
list-style-type: none;
17+
padding: 0;
18+
display: grid;
19+
margin: auto;
20+
}
21+
22+
.menu li {
23+
grid-area: 1/1;
24+
transform: rotate(calc(var(--rotation-angle) + var(--delta)))
25+
translateX(var(--diameter))
26+
rotate(calc(-1 * (var(--rotation-angle) + var(--delta))));
27+
}
28+
29+
.menu li:nth-child(1) {
30+
--rotation-angle: calc(-5 * var(--i));
31+
}
32+
33+
.menu li:nth-child(2) {
34+
--rotation-angle: calc(-4 * var(--i));
35+
}
36+
37+
.menu li:nth-child(3) {
38+
--rotation-angle: calc(-3 * var(--i));
39+
}
40+
41+
.menu li:nth-child(4) {
42+
--rotation-angle: calc(-2 * var(--i));
43+
}
44+
45+
.menu li:nth-child(5) {
46+
--rotation-angle: calc(-1 * var(--i));
47+
}
48+
49+
.menu li:nth-child(6) {
50+
--rotation-angle: calc(0 * var(--i));
51+
}
52+
53+
.menu li:nth-child(7) {
54+
--rotation-angle: calc(1 * var(--i));
55+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import getMenuItems from 'src/utils/appsMenu';
2+
import styles from './CircularMenu.module.scss';
3+
import _ from 'lodash';
4+
import CircularMenuItem from './CircularMenuItem';
5+
import { useActiveMenuItem } from 'src/hooks/useActiveMenuItem';
6+
7+
declare module 'react' {
8+
interface CSSProperties {
9+
'--diameter'?: string;
10+
'--delta'?: string;
11+
'--i'?: string;
12+
}
13+
}
14+
15+
function CircularMenu({ circleSize }) {
16+
const chunkSize = 7;
17+
const linkChunks = _.chunk(getMenuItems(), chunkSize);
18+
19+
const { isActiveItem, activeItem } = useActiveMenuItem(getMenuItems());
20+
21+
const calculateDiameter = (index, circleSize) => {
22+
const menuCircleDiameter = circleSize / 2 + 45 * (index + 1) - 10;
23+
const nextLevelMenuAngle = index === 1 ? -28 : 0; // decreases the angle of second menu layer
24+
const menuItemsAngle = index === 1 ? 16 : 23; // angle in which menu items spread around the brain
25+
return { menuCircleDiameter, nextLevelMenuAngle, menuItemsAngle };
26+
};
27+
28+
return (
29+
<div>
30+
{linkChunks.map((chunk, index) => {
31+
const { menuCircleDiameter, nextLevelMenuAngle, menuItemsAngle } =
32+
calculateDiameter(index, circleSize);
33+
return (
34+
<div
35+
key={index}
36+
className={styles.circle}
37+
style={{ width: circleSize, height: circleSize }}
38+
>
39+
<div
40+
className={styles.menu}
41+
style={{
42+
'--diameter': `${menuCircleDiameter}px`,
43+
'--delta': `${nextLevelMenuAngle}deg`,
44+
'--i': `${menuItemsAngle}deg`,
45+
}}
46+
>
47+
{chunk.map((item, index) => {
48+
const isSelected = activeItem?.name === item.name;
49+
return (
50+
<li key={index}>
51+
<CircularMenuItem
52+
item={item}
53+
onClick={() => isActiveItem(item)}
54+
selected={isSelected}
55+
/>
56+
</li>
57+
);
58+
})}
59+
</div>
60+
</div>
61+
);
62+
})}
63+
</div>
64+
);
65+
}
66+
67+
export default CircularMenu;

src/components/appMenu/CircularMenuItem.module.scss renamed to src/components/appMenu/CircularMenu/CircularMenuItem.module.scss

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
@import '../../style/mixins.scss';
1+
@import '../../../style/mixins.scss';
22

3-
.menu_item {
3+
.menuItem {
44
box-shadow: 0px 0px 13px #ffffff54;
55
opacity: 1;
66
background-color: #101010;
77
border-radius: 50%;
8-
width: var(--button-size, 38px);
9-
height: var(--button-size, 38px);
8+
width: 38px;
9+
height: 38px;
1010
justify-content: center;
1111
align-items: center;
1212
display: flex;
13+
pointer-events: auto;
1314
}
1415

15-
.menu_item.active {
16+
.menuItem.active {
1617
border: 1px solid #ffffff6b;
1718
box-shadow: 0px 0px 8px #ffffff98 inset, 0px 0px 13px #ffffff98;
1819
width: 100%;
1920
height: 100%;
2021
}
2122

22-
.menu_item:hover {
23+
.menuItem:hover {
2324
border: 1px solid #4ed6ae;
2425
box-shadow: 0px 0px 8px #4ed6ae inset, 0px 0px 13px #4ed6ae;
2526
}
@@ -30,8 +31,8 @@
3031
}
3132

3233
.icon {
33-
width: var(--icon-size, 30px);
34-
height: var(--icon-size, 30px);
34+
width: 30px;
35+
height: 30px;
3536
object-fit: fill;
3637
border-radius: 50%;
3738
justify-content: center;
@@ -42,8 +43,7 @@
4243
.external {
4344
display: block;
4445
position: absolute;
45-
bottom: 0;
46-
right: 0;
46+
bottom: 5px;
4747
transform: translate(50%, 50%);
4848
width: 20px;
4949
height: 20px;

src/components/appMenu/CircularMenuItem.tsx renamed to src/components/appMenu/CircularMenu/CircularMenuItem.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function CircularMenuItem({ item, onClick, selected }: Props) {
1414
const isExternal = item.to.startsWith('http');
1515

1616
return (
17-
<div className={cx(styles.menu_item, { [styles.active]: selected })}>
17+
<div className={cx(styles.menuItem, { [styles.active]: selected })}>
1818
<AdviserHoverWrapper adviserContent={item.name}>
1919
<NavLink
2020
to={item.to}
@@ -26,7 +26,6 @@ function CircularMenuItem({ item, onClick, selected }: Props) {
2626
{isExternal && <span className={styles.external}></span>}
2727
</NavLink>
2828
</AdviserHoverWrapper>
29-
3029
</div>
3130
);
3231
}

0 commit comments

Comments
 (0)