-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
190 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/app/pages/Market/crypto-exchange/components/StepDescription.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
37
src/app/pages/Market/crypto-exchange/components/Stepper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
72
src/app/pages/Market/crypto-exchange/steps/OrderCreation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters