<MessageTimestamp>
: make timestamp
prop required
This commit is contained in:
parent
26100ea562
commit
a3b1b696db
2 changed files with 3 additions and 7 deletions
|
@ -41,7 +41,7 @@ const times = (): Array<[string, number]> => [
|
|||
|
||||
const createProps = (overrideProps: Partial<Props> = {}): Props => ({
|
||||
i18n,
|
||||
timestamp: overrideProps.timestamp,
|
||||
timestamp: overrideProps.timestamp || Date.now(),
|
||||
now: Date.now(),
|
||||
module: text('module', ''),
|
||||
withImageNoCaption: boolean('withImageNoCaption', false),
|
||||
|
|
|
@ -12,7 +12,7 @@ import { Time } from '../Time';
|
|||
|
||||
export type Props = {
|
||||
now: number;
|
||||
timestamp?: number;
|
||||
timestamp: number;
|
||||
module?: string;
|
||||
withImageNoCaption?: boolean;
|
||||
withSticker?: boolean;
|
||||
|
@ -30,13 +30,9 @@ export function MessageTimestamp({
|
|||
withImageNoCaption,
|
||||
withSticker,
|
||||
withTapToViewExpired,
|
||||
}: Readonly<Props>): null | ReactElement {
|
||||
}: Readonly<Props>): ReactElement {
|
||||
const moduleName = module || 'module-timestamp';
|
||||
|
||||
if (timestamp === null || timestamp === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Time
|
||||
className={classNames(
|
||||
|
|
Loading…
Reference in a new issue