Skip to content

Commit

Permalink
feat: remove custom theme for DatePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneshen-okta committed Dec 14, 2022
1 parent 8c954cc commit f7dcd4c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* See the License for the specific language governing permissions and limitations under the License.
*/

import React from "react";
import type { Story } from "@storybook/react";
import { InputBase, InputBaseProps } from "@okta/odyssey-react-mui";
import {
Expand All @@ -21,7 +22,6 @@ import {
import { MuiThemeDecorator } from "../../../../.storybook/components/MuiThemeDecorator";

import DatePickerMdx from "./DatePicker.mdx";
import { DatePickerThemeProvider } from "./DatePickerThemeProvider";

export default {
title: `Labs Components/DatePicker`,
Expand Down Expand Up @@ -64,12 +64,19 @@ export default {
decorators: [MuiThemeDecorator],
};

const Template: Story<DatePickerProps<unknown, unknown>> = (props) => (
<LocalizationProvider dateAdapter={AdapterDateFns}>
<DatePickerThemeProvider>
<DatePicker {...props} />
</DatePickerThemeProvider>
</LocalizationProvider>
);
const Template: Story<DatePickerProps<unknown, unknown>> = (props) => {
const [value, setValue] = React.useState<unknown | null>(null);
const datePickerProps = {
...props,
value,
onChange: (newValue: unknown) => setValue(newValue),
};

return (
<LocalizationProvider dateAdapter={AdapterDateFns}>
<DatePicker {...datePickerProps} />
</LocalizationProvider>
);
};

export const DatePickerPrimary = Template.bind({});

This file was deleted.

This file was deleted.

0 comments on commit f7dcd4c

Please sign in to comment.