moving to elements

This commit is contained in:
Elijah Lucian 2021-07-13 17:51:30 -06:00
parent 2b94223389
commit 49a3fa1d5f
5 changed files with 13 additions and 8 deletions

View File

@ -3,6 +3,7 @@ import { useState, useEffect } from 'react'
import { Password, User } from '../../types' import { Password, User } from '../../types'
import { useUserContext } from '../../contexts/UserContext' import { useUserContext } from '../../contexts/UserContext'
import { message } from 'antd' import { message } from 'antd'
import { Button } from '../../elements/Button'
export const UserForm = () => { export const UserForm = () => {
const { user } = useUserContext() const { user } = useUserContext()
@ -78,9 +79,9 @@ export const UserForm = () => {
onChange={(e) => setPasswordConfirm(e.target.value)} onChange={(e) => setPasswordConfirm(e.target.value)}
/> />
</label> </label>
<button type="submit" disabled={!valid}> <Button htmlType="submit" disabled={!valid}>
Save Save
</button> </Button>
</form> </form>
</> </>
) )

View File

@ -1,10 +1,11 @@
import { ReactNode } from 'react' import { ReactNode } from 'react'
import { Avatar, Button, Dropdown, Menu } from 'antd' import { Avatar, Dropdown, Menu } from 'antd'
import { Header } from 'antd/lib/layout/layout' import { Header } from 'antd/lib/layout/layout'
import { Link, useHistory } from 'react-router-dom' import { Link, useHistory } from 'react-router-dom'
import { useUserContext } from '../../contexts/UserContext' import { useUserContext } from '../../contexts/UserContext'
import './style.scss' import './style.scss'
import { Button } from '../../elements/Button'
type Props = { type Props = {
children: ReactNode children: ReactNode

View File

@ -1,5 +1,6 @@
import { Button, Input, Layout } from 'antd' import { Input, Layout } from 'antd'
import { useState } from 'react' import { useState } from 'react'
import { Button } from '../../elements/Button'
export const ForgotPassword = () => { export const ForgotPassword = () => {
const [email, setEmail] = useState('') const [email, setEmail] = useState('')

View File

@ -1,5 +1,6 @@
import { InputNumber } from 'antd' import { InputNumber } from 'antd'
import { useState } from 'react' import { useState } from 'react'
import { Button } from '../../elements/Button'
import '../../scss/transaction-modal.scss' import '../../scss/transaction-modal.scss'
type Props = { type Props = {
@ -52,8 +53,8 @@ export const TransactionForm = ({ stackId }: Props) => {
Select Account Select Account
</option> </option>
</select> </select>
<button type="button">cancel</button> <Button htmlType="button">cancel</Button>
<button type="submit">Submit</button> <Button htmlType="submit">Submit</Button>
</label> </label>
</form> </form>
</div> </div>

View File

@ -3,6 +3,7 @@ import { message } from 'antd'
import { useUserContext } from '../../contexts/UserContext' import { useUserContext } from '../../contexts/UserContext'
import './style.scss' import './style.scss'
import { Button } from '../../elements/Button'
type Props = { type Props = {
selectProfile: (id: string) => void selectProfile: (id: string) => void
@ -22,12 +23,12 @@ export const AccountSelect = ({ selectProfile }: Props) => {
<div className="account-select"> <div className="account-select">
{accounts?.length {accounts?.length
? accounts.map((account) => ( ? accounts.map((account) => (
<button <Button
key={`account-${account.name}`} key={`account-${account.name}`}
onClick={() => handleSelect(account.id)} onClick={() => handleSelect(account.id)}
> >
{account.name} {account.name}
</button> </Button>
)) ))
: ''} : ''}
<Link to="/account/new">Create New Budget!</Link> <Link to="/account/new">Create New Budget!</Link>