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

created time picker input component #197

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions components/common/time_picker_input/time_picker.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as React from 'react'

import { ComponentMeta, ComponentStory } from '@storybook/react'
import { TimePickerInput } from './time_picker'

export default {
title: 'Common/TimePicker Input',
component: TimePickerInput,
} as ComponentMeta<typeof TimePickerInput>

const Template: ComponentStory<typeof TimePickerInput> = (args) => (
<TimePickerInput {...args} />
)

export const Primary = Template.bind({})
Primary.args = {}
37 changes: 37 additions & 0 deletions components/common/time_picker_input/time_picker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import * as React from 'react'

export const TimePickerInput: React.FC<
TimePickerInputProps
> = (): React.ReactElement => {
const [hours, setHours] = React.useState('')
const [minutes, setMinutes] = React.useState('')

const handleHoursChange = (e) => {
setHours(e.target.value)
}

const handleMinutesChange = (e) => {
setMinutes(e.target.value)
}

return (
<div className="flex items-center">
<label htmlFor="hours" className="mr-5">
Time Limit
</label>
<input
id="minutes"
placeholder="00"
type="number"
min="0"
max="600"
className="p-1 border border-gray-300 rounded"
value={minutes}
onChange={handleMinutesChange}
/>
<span className="mx-1">minutes</span>
</div>
)
}

type TimePickerInputProps = {}
62 changes: 29 additions & 33 deletions docs/4256.fd37dfb9.iframe.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,10 @@
throw new Error(
`Failed to load stylesheet: ${href}`
)
return res
.text()
.then((text) => ({
href,
content: text,
}))
return res.text().then((text) => ({
href,
content: text,
}))
})
.catch((err) => {
throw markAssetError(err)
Expand Down Expand Up @@ -3208,33 +3206,31 @@
const route =
_removeTrailingSlash.removeTrailingSlash(pathname)
yield Promise.all([
_this.pageLoader
._isSsg(route)
.then(
(isSsg) =>
!!isSsg &&
fetchNextData({
dataHref:
(null == data
? void 0
: data.dataHref) ||
_this.pageLoader.getDataHref({
href: url,
asPath: resolvedAs,
locale,
}),
isServerRender: !1,
parseJSON: !0,
inflightCache: _this.sdc,
persistCache: !_this.isPreview,
isPrefetch: !0,
unstable_skipClientCache:
options.unstable_skipClientCache ||
(options.priority &&
!!process.env
.__NEXT_OPTIMISTIC_CLIENT_CACHE),
}).then(() => !1)
),
_this.pageLoader._isSsg(route).then(
(isSsg) =>
!!isSsg &&
fetchNextData({
dataHref:
(null == data
? void 0
: data.dataHref) ||
_this.pageLoader.getDataHref({
href: url,
asPath: resolvedAs,
locale,
}),
isServerRender: !1,
parseJSON: !0,
inflightCache: _this.sdc,
persistCache: !_this.isPreview,
isPrefetch: !0,
unstable_skipClientCache:
options.unstable_skipClientCache ||
(options.priority &&
!!process.env
.__NEXT_OPTIMISTIC_CLIENT_CACHE),
}).then(() => !1)
),
_this.pageLoader[
options.priority ? 'loadPage' : 'prefetch'
](route),
Expand Down
12 changes: 5 additions & 7 deletions docs/sb-manager/chunk-Q24ETD7W.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36251,13 +36251,11 @@ var getTools = (getFn) => Object.values(getFn(Addon_TypesEnum.TOOL)),
return import_react75.default.createElement(
import_react75.default.Fragment,
null,
list
.filter(Boolean)
.map(({ render: Render, id, ...t4 }, index3) =>
import_react75.default.createElement(Render, {
key: id || t4.key || `f-${index3}`,
})
)
list.filter(Boolean).map(({ render: Render, id, ...t4 }, index3) =>
import_react75.default.createElement(Render, {
key: id || t4.key || `f-${index3}`,
})
)
)
})
function toolbarItemHasBeenExcluded(item, entry) {
Expand Down