Add types for <ConversationHeader>'s mute options

This commit is contained in:
Evan Hahn 2021-04-01 16:02:22 -05:00 committed by Josh Perez
parent cf50550936
commit 130dac527f
2 changed files with 4 additions and 4 deletions

View file

@ -18,7 +18,7 @@ import { InContactsIcon } from '../InContactsIcon';
import { LocalizerType } from '../../types/Util'; import { LocalizerType } from '../../types/Util';
import { ColorType } from '../../types/Colors'; import { ColorType } from '../../types/Colors';
import { getMuteOptions } from '../../util/getMuteOptions'; import { MuteOption, getMuteOptions } from '../../util/getMuteOptions';
import { import {
ExpirationTimerOptions, ExpirationTimerOptions,
TimerOption, TimerOption,
@ -375,7 +375,7 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
onMoveToInbox, onMoveToInbox,
} = this.props; } = this.props;
const muteOptions = []; const muteOptions: Array<MuteOption> = [];
if (isMuted(muteExpiresAt)) { if (isMuted(muteExpiresAt)) {
const expires = moment(muteExpiresAt); const expires = moment(muteExpiresAt);
const muteExpirationLabel = moment().isSame(expires, 'day') const muteExpirationLabel = moment().isSame(expires, 'day')

View file

@ -1,10 +1,10 @@
// Copyright 2020 Signal Messenger, LLC // Copyright 2020-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only // SPDX-License-Identifier: AGPL-3.0-only
import moment from 'moment'; import moment from 'moment';
import { LocalizerType } from '../types/Util'; import { LocalizerType } from '../types/Util';
type MuteOption = { export type MuteOption = {
name: string; name: string;
disabled?: boolean; disabled?: boolean;
value: number; value: number;