Skip to content

Commit

Permalink
TW-1360: EVM Design. Home page. Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-tsx committed May 14, 2024
1 parent f6c0321 commit b30f879
Show file tree
Hide file tree
Showing 20 changed files with 111 additions and 214 deletions.
92 changes: 0 additions & 92 deletions TODO.md

This file was deleted.

15 changes: 6 additions & 9 deletions src/app/atoms/ActionsDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ export const ActionsDropdownPopup: FC<PropsWithChildren<Props>> = ({
lowering = 1,
style,
children
}) => {
//
return (
<DropdownWrapper opened={opened} design="day" className={`p-2 flex flex-col mt-${lowering}`} style={style}>
<div className="py-2.5 px-2 text-font-small-bold text-grey-1">{title()}</div>
}) => (
<DropdownWrapper opened={opened} design="day" className={`p-2 flex flex-col mt-${lowering}`} style={style}>
<div className="py-2.5 px-2 text-font-small-bold text-grey-1">{title()}</div>

{children}
</DropdownWrapper>
);
};
{children}
</DropdownWrapper>
);
4 changes: 1 addition & 3 deletions src/app/atoms/CleanButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React, { memo, useMemo } from 'react';

import classNames from 'clsx';

import { ReactComponent as CleanIcon } from 'app/icons/base/x_circle_fill.svg';
import { t } from 'lib/i18n';
import useTippy from 'lib/ui/useTippy';
Expand Down Expand Up @@ -32,7 +30,7 @@ const CleanButton = memo<Props>(({ onClick }) => {
id={CLEAN_BUTTON_ID}
ref={buttonRef}
type="button"
className={classNames('absolute right-3 bottom-2', 'flex items-center', 'transition ease-in-out duration-200')}
className="absolute right-3 bottom-2 flex items-center ease-in-out duration-200"
tabIndex={-1}
onClick={onClick}
>
Expand Down
2 changes: 1 addition & 1 deletion src/app/atoms/CustomModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const CustomModal = memo<CustomModalProps>(props => {
beforeClose: ModStyles.overlayClosed
}}
className={{
base: clsx('bg-white rounded shadow-2xl', 'ease-in-out duration-200', ModStyles.base, className),
base: clsx('bg-white rounded shadow-2xl ease-in-out duration-200', ModStyles.base, className),
afterOpen: ModStyles.opened,
beforeClose: ModStyles.closed
}}
Expand Down
7 changes: 7 additions & 0 deletions src/app/atoms/CustomModal/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
(!) Definition order influences precedence. Keep the order.
Library applies them at the same time for some states,
while precedence has to take place.
*/

/* Overlay */

.overlayBase {
Expand Down
2 changes: 1 addition & 1 deletion src/app/atoms/DonationBanner/DonationBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const DonationBanner = memo(() => (
testID={DonationBannerSelectors.ukraineDonationBanner}
>
<span className="font-inter font-semibold mr-3 text-sm text-blue-650">
<T id={'support'} />
<T id="support" />
</span>

<Ukraine />
Expand Down
23 changes: 11 additions & 12 deletions src/app/atoms/ImportTabSwitcher.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
import React from 'react';
import React, { memo } from 'react';

import classNames from 'clsx';
import clsx from 'clsx';

import { TID, T } from 'lib/i18n';
import { Link } from 'lib/woozie';

type ImportTabDescriptor = {
interface ImportTabDescriptor {
slug: string;
i18nKey: TID;
};
}

type ImportTabSwitcherProps = {
className?: string;
interface Props {
tabs: ImportTabDescriptor[];
activeTabSlug: string;
urlPrefix: string;
};
}

const ImportTabSwitcher: React.FC<ImportTabSwitcherProps> = ({ className, tabs, activeTabSlug, urlPrefix }) => (
<div className={classNames('w-full mb-8', className)} style={{ borderBottomWidth: 1, fontSize: 17 }}>
<div className={classNames('flex items-center justify-around')}>
const ImportTabSwitcher = memo<Props>(({ tabs, activeTabSlug, urlPrefix }) => (
<div className="w-full mb-8 border-b text-ulg">
<div className="flex items-center justify-around">
{tabs.map(({ slug, i18nKey }) => {
const active = slug === activeTabSlug;

return (
<Link key={slug} to={`${urlPrefix}/${slug}`} replace>
<div
className={classNames(
className={clsx(
'text-center cursor-pointer pb-1 pt-2 px-4 border-b-2',
'text-gray-500 truncate',
'transition ease-in-out duration-300',
Expand All @@ -40,6 +39,6 @@ const ImportTabSwitcher: React.FC<ImportTabSwitcherProps> = ({ className, tabs,
})}
</div>
</div>
);
));

export default ImportTabSwitcher;
6 changes: 3 additions & 3 deletions src/app/atoms/Name.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, HTMLAttributes, useMemo } from 'react';
import React, { FC, HTMLAttributes } from 'react';

import classNames from 'clsx';

Expand All @@ -8,8 +8,8 @@ interface NameProps extends HTMLAttributes<HTMLDivElement>, TestIDProps {}

const Name: FC<NameProps> = ({ className, style = {}, testID, ...rest }) => (
<div
className={classNames('whitespace-nowrap overflow-x-auto truncate no-scrollbar', className)}
style={useMemo(() => ({ maxWidth: '12rem', ...style }), [style])}
className={classNames('max-w-48 whitespace-nowrap overflow-x-auto truncate no-scrollbar', className)}
style={style}
{...setTestID(testID)}
{...rest}
/>
Expand Down
16 changes: 6 additions & 10 deletions src/app/atoms/NetworksLogos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import OptimismIconSrc from 'app/icons/networks/optimism.svg?url';
import PolygonIconSrc from 'app/icons/networks/polygon.svg?url';
import TezosIconSrc from 'app/icons/networks/tezos.svg?url';

export const TezosNetworkLogo = memo(() => <NetworkLogoBase src={TezosIconSrc} alt="Tezos" className="bg-white" />);
export const TezosNetworkLogo = memo(() => <NetworkLogoBase src={TezosIconSrc} alt="Tezos" />);

export const EvmNetworksLogos: FC = () => (
<div className="flex">
<NetworkLogoBase src={OptimismIconSrc} alt="Optimism" className="bg-white" />
<NetworkLogoBase src={PolygonIconSrc} alt="Polygon" className="bg-white" style={SHIFTED_LOGO_STYLE} />
<NetworkLogoBase src={BinanceSmartChainIconSrc} alt="BSC" className="bg-white" style={SHIFTED_LOGO_STYLE} />
<NetworkLogoBase src={EthereumIconSrc} alt="ETH" className="bg-white" style={SHIFTED_LOGO_STYLE} />
<NetworkLogoBase src={OptimismIconSrc} alt="Optimism" />
<NetworkLogoBase src={PolygonIconSrc} alt="Polygon" className="-ml-3.5" />
<NetworkLogoBase src={BinanceSmartChainIconSrc} alt="BSC" className="-ml-3.5" />
<NetworkLogoBase src={EthereumIconSrc} alt="ETH" className="-ml-3.5" />
</div>
);

Expand All @@ -32,11 +32,7 @@ const NetworkLogoBase = memo<NetworkLogoBaseProps>(({ src, alt, className, style
alt={alt}
width={24}
height={24}
className={clsx('p-0.5 border border-grey-4 rounded-full', className)}
className={clsx('p-0.5 border border-grey-4 bg-white rounded-full', className)}
style={style}
/>
));

const SHIFTED_LOGO_STYLE: React.CSSProperties = {
marginLeft: '-14px'
};
7 changes: 7 additions & 0 deletions src/app/atoms/PageModal/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
(!) Definition order influences precedence. Keep the order.
Library applies them at the same time for some states,
while precedence has to take place.
*/

.base {
translate: 0 110%;
}
Expand Down
5 changes: 2 additions & 3 deletions src/app/atoms/TotalEquity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BigNumber from 'bignumber.js';

import { useTotalBalance } from 'app/hooks/use-total-balance';
import { useSelector } from 'app/store';
import { TEZOS_SYMBOL, TEZ_TOKEN_SLUG } from 'lib/assets';
import { TEZ_TOKEN_SLUG } from 'lib/assets';
import { useTezosAssetBalance } from 'lib/balances';
import { useFiatCurrency, useFiatToUsdRate } from 'lib/fiat-currency';
import { TEZOS_METADATA } from 'lib/metadata';
Expand Down Expand Up @@ -66,7 +66,6 @@ const TotalEquityForTezosOnlyInFiat = memo<{ amountInDollar: string }>(({ amount

return (
<>
{/* <span className="mr-1">≈</span> */}
<Money smallFractionFont={false} fiat>
{amountInFiat}
</Money>
Expand Down Expand Up @@ -94,7 +93,7 @@ const TotalEquityForTezosOnlyInGas = memo<{ accountPkh: string; amountInDollar:
<>
<Money smallFractionFont={false}>{amountInGas || ZERO}</Money>
<span style={SYMBOL_STYLE} className="font-semibold">
{TEZOS_SYMBOL}
TEZ
</span>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const ChangelogOverlay: FC = () => {

return ready && lastShownVersion !== APP_VERSION ? (
<>
<div className={'fixed inset-0 opacity-20 bg-gray-700 z-overlay-promo'}></div>
<div className="fixed inset-0 opacity-20 bg-gray-700 z-overlay-promo"></div>

<div className={classNames(LAYOUT_CONTAINER_CLASSNAME, 'fixed z-overlay-promo max-h-full', popupClassName)}>
<div
Expand Down
Loading

0 comments on commit b30f879

Please sign in to comment.