This repository has been archived by the owner on May 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(create): merge income and outcome form
- Loading branch information
1 parent
f82a441
commit a91f179
Showing
27 changed files
with
208 additions
and
133 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { Container } from '@front/ui/components/layout/container' | ||
|
||
import * as styles from './App.css' | ||
import { CreateOutcome } from './features/create/create-outcome' | ||
import { CreateIncome } from './features/create/create-income' | ||
import { History } from './features/history' | ||
import { Navigation } from './features/navigation' | ||
import { CreateTransaction } from './features/create/CreateTransaction' | ||
import { Now } from './features/now' | ||
|
||
export const App = () => ( | ||
<Container className={styles.app}> | ||
<Navigation className={styles.nav} /> | ||
<CreateOutcome className={styles.outcome} /> | ||
<CreateIncome className={styles.income} /> | ||
<CreateTransaction className={styles.create} /> | ||
<Now className={styles.now} /> | ||
<History className={styles.history} /> | ||
</Container> | ||
) |
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 was deleted.
Oops, something went wrong.
87 changes: 0 additions & 87 deletions
87
front/src/features/app/features/create/create-outcome/CreateOutcome.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
front/src/features/app/features/create/helpers/fieldsToIncomeModel.ts
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,13 @@ | ||
import { IncomeModel } from '@shared/models/money/IncomeModel' | ||
|
||
export const fieldsToIncomeModel = ({ | ||
amount, | ||
comment, | ||
currency, | ||
date, | ||
}: any): IncomeModel => ({ | ||
amount: Math.round(parseFloat(amount) * 100), | ||
currency, | ||
source: comment, | ||
date, | ||
}) |
13 changes: 13 additions & 0 deletions
13
front/src/features/app/features/create/helpers/fieldsToOutcomeModel.ts
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,13 @@ | ||
import { OutcomeModel } from '@shared/models/money/OutcomeModel' | ||
|
||
export const fieldsToOutcomeModel = ({ | ||
amount, | ||
comment, | ||
currency, | ||
date, | ||
}: any): OutcomeModel => ({ | ||
amount: Math.round(parseFloat(amount) * 100), | ||
currency, | ||
category: comment, | ||
date, | ||
}) |
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 @@ | ||
export { CreateTransaction } from './CreateTransaction' |
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,7 @@ | ||
interface Props { | ||
className?: string | ||
} | ||
|
||
export const Now = ({ className }: Props) => { | ||
return <p className={className}>NOW</p> | ||
} |
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 @@ | ||
export { Now } from './Now' |
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,23 @@ | ||
import { Field, FieldRenderProps } from 'react-final-form' | ||
import { Diff } from 'utility-types' | ||
|
||
import { | ||
Toggle as JustToggle, | ||
ToggleProps, | ||
} from '@front/ui/components/form/toggle' | ||
|
||
interface OwnProps { | ||
name: string | ||
} | ||
|
||
type ComponentProps = Diff<ToggleProps, FieldRenderProps['input']> | ||
|
||
export const Toggle = ({ | ||
name, | ||
...componentProps | ||
}: OwnProps & ComponentProps) => ( | ||
<Field | ||
name={name} | ||
render={({ input }) => <JustToggle {...componentProps} {...input} />} | ||
/> | ||
) |
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
Oops, something went wrong.