mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Migrate most React class components to function components
This commit is contained in:
@@ -2,9 +2,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
import { boolean, number } from '@storybook/addon-knobs';
|
||||
|
||||
import type { Props } from './ExpireTimer';
|
||||
import { ExpireTimer } from './ExpireTimer';
|
||||
|
||||
@@ -14,23 +11,12 @@ export default {
|
||||
|
||||
const createProps = (overrideProps: Partial<Props> = {}): Props => ({
|
||||
direction: overrideProps.direction || 'outgoing',
|
||||
expirationLength: number(
|
||||
'expirationLength',
|
||||
overrideProps.expirationLength || 30 * 1000
|
||||
),
|
||||
expirationTimestamp: number(
|
||||
'expirationTimestamp',
|
||||
overrideProps.expirationTimestamp || Date.now() + 30 * 1000
|
||||
),
|
||||
withImageNoCaption: boolean(
|
||||
'withImageNoCaption',
|
||||
overrideProps.withImageNoCaption || false
|
||||
),
|
||||
withSticker: boolean('withSticker', overrideProps.withSticker || false),
|
||||
withTapToViewExpired: boolean(
|
||||
'withTapToViewExpired',
|
||||
overrideProps.withTapToViewExpired || false
|
||||
),
|
||||
expirationLength: overrideProps.expirationLength || 30 * 1000,
|
||||
expirationTimestamp:
|
||||
overrideProps.expirationTimestamp || Date.now() + 30 * 1000,
|
||||
withImageNoCaption: overrideProps.withImageNoCaption || false,
|
||||
withSticker: overrideProps.withSticker || false,
|
||||
withTapToViewExpired: overrideProps.withTapToViewExpired || false,
|
||||
});
|
||||
|
||||
export const _30Seconds = (): JSX.Element => {
|
||||
|
||||
Reference in New Issue
Block a user