Skip to content

Commit

Permalink
first step basic layout
Browse files Browse the repository at this point in the history
  • Loading branch information
lendihop committed Dec 2, 2024
1 parent 8283415 commit 41f13fb
Show file tree
Hide file tree
Showing 13 changed files with 190 additions and 63 deletions.
13 changes: 1 addition & 12 deletions public/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1923,19 +1923,8 @@
"newTopUp": {
"message": "Neue Aufladung"
},
"exchangeDetails": {
"message": "Austauschdetails eingeben"
},
"exchangeDetailsDescription": {
"message": "Laden Sie Ihr TEZ-Guthaben oder USDT-Tezos-Guthaben sofort mit $number$ Kryptowährungen auf",
"placeholders": {
"number": {
"content": "$1"
}
}
},
"privacyAndPolicyLinks": {
"message": "Indem Sie auf Aufladen klicken, stimmen Sie den \n$termsOfUse$ und $privacyPolicy$ zu",
"message": "Indem Sie auf Aufladen klicken, stimmen Sie den $termsOfUse$ und $privacyPolicy$ zu",
"placeholders": {
"termsOfUse": {
"content": "$1"
Expand Down
21 changes: 8 additions & 13 deletions public/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@
"message": "Privacy Policy"
},
"termsOfUse": {
"message": "Terms of Use"
"message": "Terms of Usage"
},
"knowledgeBase": {
"message": "Knowledge Base"
Expand Down Expand Up @@ -3152,16 +3152,14 @@
"newTopUp": {
"message": "New Top Up"
},
"exchange": {
"message": "Exchange"
},
"exchangeDetails": {
"message": "Enter exchange details"
"message": "Exchange details"
},
"exchangeDetailsDescription": {
"message": "Top up your TEZ or USDT Tezos balance instantly with $number$ cryptocurrencies",
"placeholders": {
"number": {
"content": "$1"
}
}
"message": "Enter token amount and top up your balance instantly with best rate and without registration"
},
"sellTezDetails": {
"message": "Sell TEZ details"
Expand All @@ -3184,7 +3182,7 @@
}
},
"privacyAndPolicyLinks": {
"message": "By clicking $buttonContent$ you agree with \n$termsOfUse$ and $privacyPolicy$",
"message": "By pressing $buttonContent$ you are agree with the $termsOfUse$ and $privacyPolicy$",
"placeholders": {
"buttonContent": {
"content": "$1"
Expand Down Expand Up @@ -3333,11 +3331,8 @@
"min": {
"message": "Min:"
},
"exolixWarningTopUpServiceMessage": {
"message": "The token exchange feature is provided by Exolix as third party provider. Temple wallet is not responsible for the work of third-party services."
},
"warningTopUpServiceMessage": {
"message": "The token exchange feature is provided by a third party. The Temple Wallet is not responsible for the work of third-party services."
"message": "Token exchange is powered by a third-party, and Temple Wallet is not responsible for work of third-party services."
},
"selectTokensToSwap": {
"message": "Please, select tokens to swap"
Expand Down
13 changes: 1 addition & 12 deletions public/_locales/pt/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1919,19 +1919,8 @@
"newTopUp": {
"message": "Nova reposição"
},
"exchangeDetails": {
"message": "Introduza os detalhes da troca"
},
"exchangeDetailsDescription": {
"message": "Reponha o seu saldo TEZ ou USDT Tezos instantaneamente com $number$ criptomoedas",
"placeholders": {
"number": {
"content": "$1"
}
}
},
"privacyAndPolicyLinks": {
"message": "Ao clicar em Repor, concorda com \n$termsOfUse$ e $privacyPolicy$",
"message": "Ao clicar em Repor, concorda com $termsOfUse$ e $privacyPolicy$",
"placeholders": {
"termsOfUse": {
"content": "$1"
Expand Down
13 changes: 1 addition & 12 deletions public/_locales/tr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1919,19 +1919,8 @@
"newTopUp": {
"message": "Yeni Doldurma"
},
"exchangeDetails": {
"message": "Alım satım bilgilerini girin"
},
"exchangeDetailsDescription": {
"message": "TEZ or USDT Tezos bakiyenizi anında $number$ kripto para ile doldurun",
"placeholders": {
"number": {
"content": "$1"
}
}
},
"privacyAndPolicyLinks": {
"message": "Doldur seçeneğine tıklayarak $termsOfUse$ \nve $privacyPolicy$ hükümlerini kabul etmiş olursunuz",
"message": "Doldur seçeneğine tıklayarak $termsOfUse$ ve $privacyPolicy$ hükümlerini kabul etmiş olursunuz",
"placeholders": {
"termsOfUse": {
"content": "$1"
Expand Down
6 changes: 2 additions & 4 deletions src/app/pages/Buy/Crypto/Exolix/Exolix.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { useStorage } from 'lib/temple/front';
import { UNDER_DEVELOPMENT_MSG } from 'temple/evm/under_dev_msg';
import { useAccountAddressForTezos } from 'temple/front';

import { EXOLIX_CONTACT_LINK } from './config';
import { EXOLIX_CONTACT_LINK } from '../../../Market/crypto-exchange/config';

import { ExolixSelectors } from './Exolix.selectors';
import { ExchangeDataInterface } from './exolix.types';

Expand Down Expand Up @@ -102,9 +103,6 @@ const BuyCryptoContent = memo<BuyCryptoContentProps>(({ publicKeyHash }) => {
<T id={'support'} />
</Anchor>
)}
<p className={'mt-6 text-gray-600'}>
<T id="exolixWarningTopUpServiceMessage" />
</p>
</div>
);
});
7 changes: 6 additions & 1 deletion src/app/pages/Buy/Crypto/Exolix/steps/InitialStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ import { TopUpInput } from 'app/templates/TopUpInput';
import { T, t } from 'lib/i18n';
import { useTypedSWR } from 'lib/swr';

import { EXOLIX_PRIVICY_LINK, EXOLIX_TERMS_LINK, INITIAL_COIN_FROM, INITIAL_COIN_TO } from '../config';
import {
EXOLIX_PRIVICY_LINK,
EXOLIX_TERMS_LINK,
INITIAL_COIN_FROM,
INITIAL_COIN_TO
} from '../../../../Market/crypto-exchange/config';
import { ExolixSelectors } from '../Exolix.selectors';
import { ExchangeDataInterface, ExchangeDataStatusEnum, OutputCurrencyInterface } from '../exolix.types';
import { getCurrencies, loadMinMaxFields, queryExchange, submitExchange } from '../exolix.util';
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/Buy/Crypto/Exolix/steps/WarningComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import classNames from 'clsx';
import { CurrencyToken } from 'app/templates/TopUpInput';
import { T } from 'lib/i18n';

import { EXOLIX_CONTACT_LINK } from '../config';
import { EXOLIX_CONTACT_LINK } from '../../../../Market/crypto-exchange/config';
import { getProperNetworkFullName } from '../exolix.util';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React, { memo } from 'react';

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

interface Props {
title: TID;
description: TID;
}

export const StepDescription = memo<Props>(({ title, description }) => {
return (
<div className="flex flex-col py-1 mt-1 gap-y-0.5">
<p className="text-font-description-bold">
<T id={title} />
</p>
<p className="text-font-description text-grey-1">
<T id={description} />
</p>
</div>
);
});
37 changes: 37 additions & 0 deletions src/app/pages/Market/crypto-exchange/components/Stepper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React, { FC, memo } from 'react';

import clsx from 'clsx';

type Status = 'active' | 'next' | 'default';

interface Props {
currentStep: 0 | 1 | 2 | 3;
}

export const Stepper = memo<Props>(({ currentStep }) => {
const first: Status = currentStep === 0 ? 'next' : 'active';
const second: Status = currentStep > 1 ? 'active' : currentStep === 1 ? 'next' : 'default';
const third: Status = currentStep > 2 ? 'active' : currentStep === 2 ? 'next' : 'default';

return (
<div className="flex flex-row h-2.5 items-center gap-x-1">
<Step status={first} />
<Step status={second} />
<Step status={third} />
</div>
);
});

interface StepProps {
status?: Status;
}

const bgColorRecord = {
active: 'bg-success',
next: 'bg-success-low',
default: 'bg-grey-4'
};

const Step: FC<StepProps> = ({ status = 'default' }) => (
<div className={clsx('w-full h-1.5 rounded', bgColorRecord[status])} />
);
File renamed without changes.
18 changes: 18 additions & 0 deletions src/app/pages/Market/crypto-exchange/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React, { FC } from 'react';

import { PageModal } from 'app/atoms/PageModal';

import { OrderCreation } from './steps/OrderCreation';

interface Props {
opened: boolean;
onRequestClose: EmptyFn;
}

export const CryptoExchange: FC<Props> = ({ opened, onRequestClose }) => {
return (
<PageModal title="Crypto Exchange" opened={opened} onRequestClose={onRequestClose}>
<OrderCreation />
</PageModal>
);
};
72 changes: 72 additions & 0 deletions src/app/pages/Market/crypto-exchange/steps/OrderCreation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import React, { FC, memo } from 'react';

import { ActionsButtonsBox } from 'app/atoms/PageModal/actions-buttons-box';
import { StyledButton } from 'app/atoms/StyledButton';
import { T } from 'lib/i18n';

import { StepDescription } from '../components/StepDescription';
import { Stepper } from '../components/Stepper';
import { EXOLIX_PRIVICY_LINK, EXOLIX_TERMS_LINK } from '../config';

export const OrderCreation: FC = () => {
return (
<>
<form id="create-order-form" className="flex-1 pt-4 px-4 flex flex-col overflow-y-auto">
<Stepper currentStep={0} />

<StepDescription title="exchangeDetails" description="exchangeDetailsDescription" />

<ExchangeRateCard exchangeRate="1 ETH ≈ 78.67 TEZ" />
</form>

<ActionsButtonsBox>
<StyledButton type="submit" form="create-order-form" size="L" color="primary">
<T id="exchange" />
</StyledButton>
</ActionsButtonsBox>
</>
);
};

const ExchangeRateCard = memo<{ exchangeRate: string }>(({ exchangeRate }) => (
<div className="flex flex-col pt-2 p-4 mb-8 rounded-lg shadow-bottom border-0.5 border-transparent">
<div className="py-3 flex flex-row justify-between items-center border-b-0.5 border-lines text-font-description">
<p className="p-1 text-grey-1">
<T id="exchangeRate" />
</p>
<p className="p-1">{exchangeRate}</p>
</div>

<div className="pt-2 px-1 flex flex-col gap-y-2 text-font-small text-grey-1">
<p>
<T
id="privacyAndPolicyLinks"
substitutions={[
<T id="exchange" key="buttonContent" />,
<a
className="text-font-small-bold underline"
rel="noreferrer"
href={EXOLIX_TERMS_LINK}
target="_blank"
key="termsOfUse"
>
<T id="termsOfUse" />
</a>,
<a
className="text-font-small-bold underline"
rel="noreferrer"
href={EXOLIX_PRIVICY_LINK}
target="_blank"
key="privacy"
>
<T id="privacyPolicy" />
</a>
]}
/>
</p>
<p>
<T id="warningTopUpServiceMessage" />
</p>
</div>
</div>
));
30 changes: 22 additions & 8 deletions src/app/pages/Market/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,32 @@ import { ReactComponent as CardIcon } from 'app/icons/base/card.svg';
import { ReactComponent as RouteIcon } from 'app/icons/base/route.svg';
import PageLayout from 'app/layouts/PageLayout';
import { t } from 'lib/i18n/react';
import { useBooleanState } from 'lib/ui/hooks';
import { Link } from 'lib/woozie';

import { CryptoExchange } from './crypto-exchange';

export const Market = memo(() => {
const [cryptoExchangeModalOpened, setCryptoExchangeModalOpen, setCryptoExchangeModalClosed] = useBooleanState(false);

return (
<PageLayout pageTitle={<PageTitle title={t('market')} />} noScroll>
<CaptionAlert type="info" message={t('marketPageDisclaimer')} className="mb-4" />

<Option Icon={RouteIcon} title={t('cryptoExchange')} description={t('cryptoExchangeDescription')} />
<Link to="/buy/debit">
<Option Icon={CardIcon} title={t('debitCreditCard')} description={t('debitCreditCardDescription')} />
</Link>
</PageLayout>
<>
<PageLayout pageTitle={<PageTitle title={t('market')} />} noScroll>
<CaptionAlert type="info" message={t('marketPageDisclaimer')} className="mb-4" />

<Option
Icon={RouteIcon}
title={t('cryptoExchange')}
description={t('cryptoExchangeDescription')}
onClick={setCryptoExchangeModalOpen}
/>
<Link to="/buy/debit">
<Option Icon={CardIcon} title={t('debitCreditCard')} description={t('debitCreditCardDescription')} />
</Link>
</PageLayout>

<CryptoExchange opened={cryptoExchangeModalOpened} onRequestClose={setCryptoExchangeModalClosed} />
</>
);
});

Expand Down

0 comments on commit 41f13fb

Please sign in to comment.