Files
remark42/frontend/app/components/comment/getBlockingDurations.ts
T
Pavel MineevandUmputun 5825a55b69 Update frontend
* change root dit and change way to import modules
* update deps to latest versions
* use latest tools for building bundles
* rewrite webpack config
* use nomodule technique for loading modern bundle
* inject polyfills by babel usebuiltins
* update eslint rules
* rename all style files to CSS
* use postcss preset env for building styles
* proper typescript typing
* put all html files to templates folder
* etc
2021-01-12 13:39:26 -06:00

43 lines
969 B
TypeScript

import { BlockingDuration } from 'common/types';
import { IntlShape, defineMessages } from 'react-intl';
const blockingMessages = defineMessages({
permanently: {
id: 'blockingDuration.permanently',
defaultMessage: 'Permanently',
},
month: {
id: 'blockingDuration.month',
defaultMessage: 'For a month',
},
week: {
id: 'blockingDuration.week',
defaultMessage: 'For a week',
},
day: {
id: 'blockingDuration.day',
defaultMessage: 'For a day',
},
});
export function getBlockingDurations(intl: IntlShape): BlockingDuration[] {
return [
{
label: intl.formatMessage(blockingMessages.permanently),
value: 'permanently',
},
{
label: intl.formatMessage(blockingMessages.month),
value: '43200m',
},
{
label: intl.formatMessage(blockingMessages.week),
value: '10080m',
},
{
label: intl.formatMessage(blockingMessages.day),
value: '1440m',
},
];
}