Skip to content

Commit

Permalink
fix(app): redesign (#1114)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimakorzhovnik authored Jun 30, 2024
2 parents 342ca1c + f714255 commit 6ccc626
Show file tree
Hide file tree
Showing 118 changed files with 3,270 additions and 989 deletions.
11 changes: 6 additions & 5 deletions src/components/CreatedAt/CreatedAt.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import { getNowUtcTime, timeSince } from 'src/utils/utils';
import { timeSince } from 'src/utils/utils';
import { dateToUtcNumber, getNowUtcNumber } from 'src/utils/date';
import styles from './CreatedAt.module.scss';

export type Props = {
timeAt: string | number;
timeAt: string;
};

function CreatedAt({ timeAt }: Props) {
let timeAgoInMS = 0;

const time = getNowUtcTime() - new Date(timeAt).getTime();
const time = getNowUtcNumber() - dateToUtcNumber(timeAt);
if (time && time > 0) {
timeAgoInMS = time;
}

const timeSinceValue = timeSince(timeAgoInMS);

return (
<div className={styles.createdAt}>
<span className={styles.createdAt}>
{timeSinceValue === 'now' ? timeSinceValue : `${timeSinceValue} ago`}
</div>
</span>
);
}

Expand Down
14 changes: 10 additions & 4 deletions src/components/HydrogenBalance/HydrogenBalance.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import { useGetBalanceBostrom } from 'src/containers/sigma/hooks';
import { Link } from 'react-router-dom';
import { routes } from 'src/routes';
import IconsNumber from '../IconsNumber/IconsNumber';

function HydrogenBalance({ address }) {
function HydrogenBalance({ address, className }) {
const { totalAmountInLiquid } = useGetBalanceBostrom(address);

return (
<div>
<IconsNumber value={totalAmountInLiquid.currentCap} type="hydrogen" />
</div>
<Link to={`${routes.neuron.getLink(address)}/sigma`} className={className}>
<IconsNumber
value={totalAmountInLiquid.currentCap}
type="hydrogen"
isVertical
/>
</Link>
);
}

Expand Down
13 changes: 8 additions & 5 deletions src/components/IconsNumber/IconsNumber.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import BigNumber from 'bignumber.js';
import hydrogen from '../../image/hydrogen.svg';
import { boot } from 'images/large-green.png';
import React from 'react';
import hydrogen from '../../image/hydrogen.svg';
import Tooltip from '../tooltip/tooltip';

enum TypesEnum {
Expand Down Expand Up @@ -63,7 +62,7 @@ const PREFIXES = [
},
];

export default function IconsNumber({ value, type }) {
export default function IconsNumber({ value, type, isVertical }) {
const { prefix = 1, power = 1 } =
PREFIXES.find((powerItem) => value >= powerItem.power) || {};

Expand All @@ -86,10 +85,14 @@ export default function IconsNumber({ value, type }) {
{number}{' '}
<Tooltip
contentStyle={{
display: 'inline-block',
display: 'flex',
flexDirection: isVertical ? 'column' : 'row',
}}
tooltip={
value?.toLocaleString()?.replaceAll(',', ' ') + ' ' + icons[type]
<span style={{ whiteSpace: 'nowrap' }}>
{value?.toLocaleString()?.replaceAll(',', ' ')}
{icons[type]}
</span>
}
>
{i}
Expand Down
6 changes: 3 additions & 3 deletions src/components/MusicalAddress/MusicalAddress.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
background: transparent;
border: unset;
// height: 20px;
font-size: 16px;
font-size: 14px;
// padding: 100px;
color: var(--primary-color);

Expand All @@ -28,9 +28,9 @@

.containerSignatures {
&ItemNote {
width: 7px;
width: 3px;
border-radius: 2px;
max-height: 20px;
max-height: 15px;

@media (max-width: 800px) {
width: 5px;
Expand Down
10 changes: 9 additions & 1 deletion src/components/Tabs/TabItem/TabItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import cx from 'classnames';
import { Link } from 'react-router-dom';
import { ReactNode } from 'react';
import styles from './TabItem.module.scss';

export const enum Position {
Expand All @@ -9,7 +10,7 @@ export const enum Position {

export type Props = {
type?: Position;
text: string | JSX.Element;
text: string | ReactNode;
step?: number;
isSelected: boolean;
to?: string;
Expand Down Expand Up @@ -39,6 +40,13 @@ function TabItem({
};
}

if (disable && to) {
componentProps = {
...componentProps,
onClick: (e) => e.preventDefault(),
};
}

return (
<Component
to={to}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ReactNode } from 'react';
import TabItem, { Position } from './TabItem/TabItem';
import style from './Tabs.module.scss';

type optionsProps = {
to?: string;
onClick?: () => void;
key: string;
text?: string;
text?: ReactNode;
};

type Props = {
Expand Down
5 changes: 5 additions & 0 deletions src/components/account/account.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@
color: var(--primary-color);
padding: 0;
white-space: nowrap;

width: 100%;
overflow-x: hidden;
text-overflow: ellipsis;
text-align: center;
}
15 changes: 11 additions & 4 deletions src/components/actionBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import { Networks } from 'src/types/networks';
import usePassportByAddress from 'src/features/passport/hooks/usePassportByAddress';
import { selectCurrentAddress } from 'src/redux/features/pocket';
import { useAppSelector } from 'src/redux/hooks';
import ButtonIcon from '../buttons/ButtonIcon';
import styles from './styles.module.scss';
import Button from '../btnGrd';
import { useSigningClient } from 'src/contexts/signerClient';
import { trimString } from 'src/utils/utils';
import { CHAIN_ID } from 'src/constants/config';
import ButtonIcon from '../buttons/ButtonIcon';
import styles from './styles.module.scss';
import Button from '../btnGrd';
import { createPortal } from 'react-dom';

const back = require('../../image/arrow-left-img.svg');

Expand Down Expand Up @@ -121,7 +122,7 @@ function ActionBar({ children, text, onClickBack, button }: Props) {

const content = text || children;

return (
const contentPortal = (
<ActionBarContainer>
{/* <Telegram /> */}

Expand Down Expand Up @@ -150,6 +151,12 @@ function ActionBar({ children, text, onClickBack, button }: Props) {
{/* <GitHub /> */}
</ActionBarContainer>
);

// const portalEl = document.getElementById('portalActionBar');

// return portalEl ? createPortal(contentPortal, portalEl) : contentPortal;

return contentPortal;
}

export default ActionBar;
37 changes: 31 additions & 6 deletions src/components/actionBar/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
justify-content: center;
width: 100%;
position: fixed;
bottom: 0;
bottom: 20px;
left: 0;
padding: 10px 0;
background: linear-gradient(
0deg,
rgba(0, 0, 0, 0.93) 76%,
rgba(0, 0, 0, 0) 100%
);
background: linear-gradient(0deg,
rgba(0, 0, 0, 0.93) 76%,
rgba(0, 0, 0, 0) 100%);
z-index: 2;

&Content {
Expand Down Expand Up @@ -49,4 +47,31 @@
.chooseAccount {
padding: 0 5px;
color: var(--primary-color);
}

.ActionBarWrap {
display: flex;
align-items: center;
justify-content: center;
width: 62%;
position: fixed;
bottom: 20px;
left: 50%;
transform: translate(-50%, 10px);
// padding: 10px 0;
background: #000;
z-index: 3;

&Content {
max-width: 1000px;
flex-grow: 1;
display: grid;
grid-template-columns: 0.7fr 1fr;
align-items: center;
justify-content: center;
position: relative;
padding: 10px 0px;

}

}
49 changes: 0 additions & 49 deletions src/components/appMenu/AppMenu.module.scss

This file was deleted.

Loading

0 comments on commit 6ccc626

Please sign in to comment.