mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-21 04:19:37 +02:00
Updating categories using form
This commit is contained in:
parent
0f2125e720
commit
216c12a33c
11 changed files with 176 additions and 30 deletions
|
@ -5,6 +5,7 @@ import { App, NewApp } from '../../../interfaces';
|
|||
|
||||
import ModalForm from '../../UI/Forms/ModalForm/ModalForm';
|
||||
import InputGroup from '../../UI/Forms/InputGroup/InputGroup';
|
||||
import Button from '../../UI/Buttons/Button/Button';
|
||||
|
||||
interface ComponentProps {
|
||||
modalHandler: () => void;
|
||||
|
@ -35,6 +36,12 @@ const AppForm = (props: ComponentProps): JSX.Element => {
|
|||
url: props.app.url,
|
||||
icon: props.app.icon
|
||||
})
|
||||
} else {
|
||||
setFormData({
|
||||
name: '',
|
||||
url: '',
|
||||
icon: ''
|
||||
})
|
||||
}
|
||||
}, [props.app])
|
||||
|
||||
|
@ -114,8 +121,8 @@ const AppForm = (props: ComponentProps): JSX.Element => {
|
|||
</span>
|
||||
</InputGroup>
|
||||
{!props.app
|
||||
? <button type="submit">add</button>
|
||||
: <button type="submit">update</button>
|
||||
? <Button>Add new application</Button>
|
||||
: <Button>Update application</Button>
|
||||
}
|
||||
</ModalForm>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue