Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): update timepicker page to use new layout #629

Merged
merged 1 commit into from
Oct 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions packages/docs/pages/timepicker.tsx
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import { Form, FormGroup, H1, Panel, Text, Timepicker } from '@bigcommerce/big-design';
import React, { useState } from 'react';

import { CodePreview, PageNavigation } from '../components';
import { Code, CodePreview, List } from '../components';
import { TimepickerPropTable } from '../PropTables';

const TimepickerPage = () => {
const items = [
{
id: 'examples',
title: 'Examples',
render: () => (
<Panel>
<Text>Timepicker is used to select a time in specific hours and minutes.</Text>
<CodePreview>
{/* jsx-to-string:start */}
{function Example() {
const [time, setTime] = useState<string>();

return (
<Form>
<FormGroup>
<Timepicker locale="en-US" value={time} onTimeChange={(value) => setTime(value)} />
</FormGroup>
</Form>
);
}}
{/* jsx-to-string:end */}
</CodePreview>
</Panel>
),
},
{
id: 'props',
title: 'Props',
render: () => <TimepickerPropTable />,
},
];

return (
<>
<H1>Timepicker</H1>

<PageNavigation items={items} />
<Panel header="Overview" headerId="overview">
<Text>
<Code primary>Timepicker</Code>s allow users to choose a time value from the provided options. They can be
used for a wide range of scenarios like specifiying promotion start/end time, store location working hours and
so on.
</Text>
<Text bold>When to use:</Text>
<List>
<List.Item>When there is a need to pick a time from predefined time options.</List.Item>
</List>
</Panel>

<Panel header="Implementation" headerId="implementation">
<CodePreview>
{/* jsx-to-string:start */}
{function Example() {
const [time, setTime] = useState<string>();

return (
<Form>
<FormGroup>
<Timepicker locale="en-US" value={time} onTimeChange={(value) => setTime(value)} />
</FormGroup>
</Form>
);
}}
{/* jsx-to-string:end */}
</CodePreview>
</Panel>

<Panel header="Props" headerId="props">
<TimepickerPropTable renderPanel={false} />
</Panel>
</>
);
};
Expand Down