-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cd4bdc0
commit 408b34c
Showing
3 changed files
with
57 additions
and
39 deletions.
There are no files selected for viewing
8 changes: 5 additions & 3 deletions
8
...angeInput/FinalFormRangeInput.stories.mdx → ...nalFormRangeInput/FinalFormRangeInput.mdx
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
52 changes: 52 additions & 0 deletions
52
storybook/src/docs/components/FinalFormRangeInput/FinalFormRangeInput.stories.tsx
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,52 @@ | ||
import { Field, FinalFormRangeInput } from "@comet/admin"; | ||
import { Button } from "@mui/material"; | ||
import * as React from "react"; | ||
import { Form } from "react-final-form"; | ||
|
||
export default { | ||
title: "Docs/Components/FinalFormRangeInput", | ||
}; | ||
|
||
export const Default = { | ||
render: () => { | ||
return ( | ||
<Form | ||
onSubmit={(values) => { | ||
// values | ||
}} | ||
render={({ handleSubmit, values, form, initialValues }) => ( | ||
<div style={{ display: "flex", alignItems: "center" }}> | ||
<Field component={FinalFormRangeInput} name="price" min={0} max={100} /> | ||
<div style={{ marginLeft: "40px", minHeight: "220px" }}> | ||
<h3 style={{ marginTop: 0 }}>Value</h3> | ||
<pre>{JSON.stringify(values, undefined, 2)}</pre> | ||
<Button | ||
variant="contained" | ||
color="primary" | ||
onClick={() => { | ||
form.reset(); | ||
}} | ||
> | ||
Reset | ||
</Button> | ||
</div> | ||
</div> | ||
)} | ||
/> | ||
); | ||
}, | ||
}; | ||
|
||
export const WithInitialValues = { | ||
render: () => { | ||
return ( | ||
<Form | ||
onSubmit={(values) => { | ||
// values | ||
}} | ||
initialValues={{ price: { min: 0, max: 100 } }} | ||
render={({ handleSubmit, values, form, initialValues }) => <Field component={FinalFormRangeInput} name="price" min={0} max={100} />} | ||
/> | ||
); | ||
}, | ||
}; |
36 changes: 0 additions & 36 deletions
36
storybook/src/docs/components/FinalFormRangeInput/stories/Default.stories.tsx
This file was deleted.
Oops, something went wrong.