Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
feat(hello): add CurrencySwitch
Browse files Browse the repository at this point in the history
  • Loading branch information
dmorenogogoleva committed Apr 10, 2019
1 parent c98fcf5 commit 83bda11
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions front/src/features/hello/Hello.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useCallback } from 'react'

import * as styles from './Hello.css'
import { setDefaultCurrency } from '@front/domain/user/actions/setDefaultCurrency'
import { getUserProfile } from '@front/domain/user/actions/getUserProfile'
import { CurrencySwitch } from '@front/ui/components/controls/currency-switch'
import { Currency } from '@shared/enum/Currency'

export const Hello = () => {
Expand All @@ -16,20 +16,13 @@ export const Hello = () => {
await dispatch(setDefaultCurrency(currency))
}, [])

const getProfile = useCallback(async () => {
await dispatch(getUserProfile())
}, [])

return (
<section className={styles.container}>
<h1>
Checkmoney Space
<br />
<button onClick={() => getProfile()}>get your profile</button>
<button onClick={() => setCurrency(Currency.RUB)}>
set your currency
</button>
<small>Wellcome!</small>
<CurrencySwitch currency={Currency.USD} updateCurrency={setCurrency} />
</h1>
<Button onClick={() => pushRoute('/app')}>Start</Button>
</section>
Expand Down

0 comments on commit 83bda11

Please sign in to comment.