diff --git a/apps/token/src/components/bullet-header/bullet-header.tsx b/apps/token/src/components/bullet-header/bullet-header.tsx index a08c96e15..eed46c796 100644 --- a/apps/token/src/components/bullet-header/bullet-header.tsx +++ b/apps/token/src/components/bullet-header/bullet-header.tsx @@ -10,9 +10,9 @@ export const BulletHeader = ({ tag, children, style }: BulletHeaderProps) => { return React.createElement( tag, { className: 'mt-24 pt-8 pb-20 uppercase', style }, - [ - , - children, - ] + <> + + {children} + ); }; diff --git a/apps/token/src/components/connected-vega-key/connected-vega-key.tsx.tsx b/apps/token/src/components/connected-vega-key/connected-vega-key.tsx.tsx index 90506a9c8..376f223e8 100644 --- a/apps/token/src/components/connected-vega-key/connected-vega-key.tsx.tsx +++ b/apps/token/src/components/connected-vega-key/connected-vega-key.tsx.tsx @@ -9,7 +9,9 @@ export const ConnectedVegaKey = ({ pubKey }: { pubKey: string | null }) => { {pubKey ? t('Connected Vega key') : } -

{pubKey}

+

+ {pubKey} +

); }; diff --git a/apps/token/src/components/country-selector/country-selector.tsx b/apps/token/src/components/country-selector/country-selector.tsx index ea782c34e..1591165d8 100644 --- a/apps/token/src/components/country-selector/country-selector.tsx +++ b/apps/token/src/components/country-selector/country-selector.tsx @@ -1,30 +1,7 @@ -import { MenuItem } from '@blueprintjs/core'; -import type { ItemPredicate } from '@blueprintjs/select'; -import { Suggest } from '@blueprintjs/select'; +import { Select } from '@vegaprotocol/ui-toolkit'; -import type { ICountry } from '../../routes/claim/claim-form'; import countryData from './country-data'; -const CountrySuggest = Suggest.ofType(); - -export const filterCountry: ItemPredicate = ( - query, - country, - _index, - exactMatch -) => { - const normalizedTitle = country.name.toLowerCase(); - const normalizedQuery = query.toLowerCase(); - - if (exactMatch) { - return normalizedTitle === normalizedQuery; - } else if (query.length === 2) { - return normalizedQuery === country.code.toLowerCase(); - } else { - return normalizedTitle.indexOf(normalizedQuery) >= 0; - } -}; - export interface CountrySelectorProps { onSelectCountry: (countryCode: string) => void; code: string | null | undefined; @@ -36,30 +13,18 @@ export const CountrySelector = ({ }: CountrySelectorProps) => { return (
- c.code === code) || countryData[0] - } - items={countryData} - itemRenderer={(item, { handleClick, modifiers }) => ( - - )} - onItemSelect={(item) => { - onSelectCountry(item.code); - }} - inputValueRenderer={(item) => item.name} - popoverProps={{ minimal: true }} - noResults={} - itemPredicate={filterCountry} - fill={true} - /> +
); }; diff --git a/apps/token/src/components/epoch-countdown/epoch-countdown.tsx b/apps/token/src/components/epoch-countdown/epoch-countdown.tsx index 6a4fb0c9a..ebd85148c 100644 --- a/apps/token/src/components/epoch-countdown/epoch-countdown.tsx +++ b/apps/token/src/components/epoch-countdown/epoch-countdown.tsx @@ -1,10 +1,10 @@ -import { Intent, ProgressBar } from '@blueprintjs/core'; import { format, formatDistanceStrict } from 'date-fns'; import * as React from 'react'; import { useTranslation } from 'react-i18next'; import arrow from '../../images/back.png'; import { DATE_FORMAT_DETAILED } from '../../lib/date-formats'; +import { ProgressBar } from '../progress-bar'; export interface EpochCountdownProps { id: string; @@ -68,12 +68,7 @@ export function EpochCountdown({ : t('Awaiting next epoch')}

- +

{format(startDate, DATE_FORMAT_DETAILED)}

diff --git a/apps/token/src/components/modal/index.ts b/apps/token/src/components/modal/index.ts deleted file mode 100644 index 133aa7420..000000000 --- a/apps/token/src/components/modal/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './modal'; diff --git a/apps/token/src/components/modal/modal.tsx b/apps/token/src/components/modal/modal.tsx deleted file mode 100644 index 5ec4906e4..000000000 --- a/apps/token/src/components/modal/modal.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; - -interface ModalProps { - children: React.ReactNode; - title: string; -} - -export const Modal = ({ children, title }: ModalProps) => ( -
-

{title}

-
{children}
-
-); diff --git a/apps/token/src/components/nav/nav.css b/apps/token/src/components/nav/nav.css new file mode 100644 index 000000000..6b50b698a --- /dev/null +++ b/apps/token/src/components/nav/nav.css @@ -0,0 +1,25 @@ +@keyframes slideIn { + from { + transform: translateX(100%); + } + to { + transform: translateX(0); + } +} + +@keyframes slideOut { + from { + transform: translateX(0); + } + to { + transform: translateX(100%); + } +} + +.drawer-content[data-state='open'] { + animation: slideIn 150ms ease-out forwards; +} + +.drawer-content[data-state='closed'] { + animation: slideOut 150ms ease-in forwards; +} diff --git a/apps/token/src/components/nav/nav.tsx b/apps/token/src/components/nav/nav.tsx index 816e074d8..99e82c981 100644 --- a/apps/token/src/components/nav/nav.tsx +++ b/apps/token/src/components/nav/nav.tsx @@ -1,6 +1,9 @@ -import { Drawer } from '@blueprintjs/core'; +import './nav.css'; + +import classNames from 'classnames'; import debounce from 'lodash/debounce'; import React from 'react'; +import * as Dialog from '@radix-ui/react-dialog'; import { useTranslation } from 'react-i18next'; import { Link, NavLink } from 'react-router-dom'; @@ -126,10 +129,10 @@ const NavHeader = ({ fairground }: { fairground: boolean }) => { )}

{fairground ? t('fairgroundTitle') : t('title')}

@@ -148,6 +151,13 @@ const IconLine = ({ inverted }: { inverted: boolean }) => ( const NavDrawer = ({ inverted }: { inverted: boolean }) => { const { appState, appDispatch } = useAppState(); + const drawerContentClasses = classNames( + 'drawer-content', // needed for css animation + // Positions the modal in the center of screen + 'fixed w-[80vw] max-w-[420px] top-0 right-0', + 'flex flex-col flex-nowrap justify-between h-full bg-banner overflow-y-scroll border-l border-white', + 'bg-black text-white-95' + ); return ( <> - + appDispatch({ type: AppStateActionType.SET_DRAWER, - isOpen: false, + isOpen, }) } - size="80%" - className="border border-white max-w-[420px]" > -
-
- - - - - - -
- -
-
+ + + +
+ + + + + + +
+ +
+
+ ); }; @@ -206,35 +217,36 @@ const NavLinks = ({ isDesktop }: { isDesktop: boolean }) => { { route: Routes.WITHDRAW, text: t('Withdraw') }, { route: Routes.GOVERNANCE, text: t('Governance') }, ]; + const navClasses = classNames('flex', { + 'flex-row gap-8 mt-8 uppercase': isDesktop, + 'flex-col': !isDesktop, + }); + return ( -