stuff, with a side of things

This commit is contained in:
Elijah Lucian
2021-07-15 13:51:57 -06:00
parent c62f88953e
commit 8e7fc05cd1
20 changed files with 21741 additions and 230 deletions
+10 -13
View File
@@ -1,16 +1,15 @@
import { Link } from 'react-router-dom'
import { message } from 'antd'
import { useUserContext } from '../../contexts/UserContext'
import './style.scss'
import { Button } from '../../elements/Button'
import { useAccounts } from '../../hooks/getMany/useAccounts'
type Props = {
selectProfile: (id: string) => void
}
export const AccountSelect = ({ selectProfile }: Props) => {
const { accounts } = useUserContext()
const accounts = useAccounts()
const handleSelect = (id: string) => {
selectProfile(id)
@@ -21,16 +20,14 @@ export const AccountSelect = ({ selectProfile }: Props) => {
<>
<h1>Select Account</h1>
<div className="account-select">
{accounts?.length
? accounts.map((account) => (
<Button
key={`account-${account.name}`}
onClick={() => handleSelect(account.id)}
>
{account.name}
</Button>
))
: ''}
{accounts.data?.map((account) => (
<Button
key={`account-${account.name}`}
onClick={() => handleSelect(account.id)}
>
{account.name}
</Button>
))}
<Link to="/account/new">Create New Budget!</Link>
</div>
</>