cleaned up time trigger
This commit is contained in:
1 parent
ef02abe0cb
commit
3a44057a40
14 files changed
+536
-167
No files matched your search
@@ -6,29 +6,35 @@ import { AutomationTime } from "types/automations/common";
|
||||
import { InputTime } from "./InputTime";
|
||||
|
||||
export default {
|
||||
title: 'Inputs/InputTime',
|
||||
title: "Inputs/InputTime",
|
||||
component: InputTime,
|
||||
parameters: { actions: { argTypesRegex: '^on.*' } },
|
||||
parameters: { actions: { argTypesRegex: "^on.*" } },
|
||||
} as ComponentMeta<typeof InputTime>;
|
||||
|
||||
|
||||
const Template: ComponentStory<typeof InputTime> = args => {
|
||||
|
||||
const Template: ComponentStory<typeof InputTime> = (args) => {
|
||||
const [value, setValue] = useState<AutomationTime | undefined>(undefined);
|
||||
return <Page>
|
||||
<div style={{
|
||||
padding: '1em'
|
||||
}}>
|
||||
<InputTime {...args} value={value} onChange={t => {
|
||||
setValue(t)
|
||||
args.onChange(t)
|
||||
}} />
|
||||
</div>
|
||||
</Page>
|
||||
}
|
||||
return (
|
||||
<Page>
|
||||
<div
|
||||
style={{
|
||||
padding: "1em",
|
||||
}}
|
||||
>
|
||||
<InputTime
|
||||
{...args}
|
||||
value={args.restrictEmpty ? "00:00:00" : value}
|
||||
onChange={(t) => {
|
||||
setValue(t);
|
||||
args.onChange(t);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
};
|
||||
|
||||
export const SimpleText = Template.bind({})
|
||||
export const SimpleText = Template.bind({});
|
||||
SimpleText.args = {
|
||||
label: "Time Stamp",
|
||||
value: "10"
|
||||
}
|
||||
value: "10",
|
||||
};
|
||||
Reference in new issue
Block a user