1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 22:24:27 +01:00
metamask-extension/ui/pages/swaps/countdown-timer/countdown-timer.stories.js
kumavis f472c2615a
CI - add metamaskbot comment "highlights" section for showing relevant storybook changes (#12095)
* ci/announce/highlight - add bot announcement section for "highlights" showing off important diffs + storybook highlights

* ci/announce/highlight - fix announcement message

* Update index.js

* xxx tmp xxx

* ci/announce/highlight - fix dirty file calculation

* ci/announce/highlight - try/catch wrap highlight generation for build stability

* ui - put fox emojis in the mascot component

* ci/announce/highlight - start storybook permalinks

* ci/announce/highlight - fix storybook permalink util

* ci/announce/highlight - fix storybook permalink util

* ci/announce/highlight - small styling fix

* storybook - use any easily predictable story id

* ci/announce/highlight - revert sample commit

* ci/announce/highlight - minimal documentation
2021-09-15 08:55:48 -10:00

65 lines
1.4 KiB
JavaScript

import React from 'react';
import { number } from '@storybook/addon-knobs';
import CountdownTimer from './countdown-timer';
export default {
title: 'CountdownTimer',
id: __filename,
};
const getTimeStartedFromDecrimentSeconds = (seconds) =>
Date.now() - seconds * 1000;
export const Default = () => {
const timeStartedSecondDecriment = number(
'Set timeStarted to curren time minus X seconds',
10,
);
return (
<CountdownTimer
timeStarted={getTimeStartedFromDecrimentSeconds(
timeStartedSecondDecriment,
)}
timeOnly
/>
);
};
export const CustomTimerBase = () => {
const timeStartedSecondDecriment = number(
'Set timeStarted to curren time minus X seconds',
10,
);
return (
<CountdownTimer
timeStarted={getTimeStartedFromDecrimentSeconds(
timeStartedSecondDecriment,
)}
timerBase={150000}
timeOnly
/>
);
};
// Label keys used in below stories are just for demonstration purposes
export const WithLabelInfoTooltipAndWarning = () => {
const timeStartedSecondDecriment = number(
'Set timeStarted to curren time minus X seconds',
0,
);
return (
<CountdownTimer
timeStarted={getTimeStartedFromDecrimentSeconds(
timeStartedSecondDecriment,
)}
timerBase={20000}
labelKey="disconnectPrompt"
infoTooltipLabelKey="disconnectAllAccountsConfirmationDescription"
warningTime="0:15"
/>
);
};