diff --git a/js/modules/signal.js b/js/modules/signal.js index 45a78f0f13e4..24513205e270 100644 --- a/js/modules/signal.js +++ b/js/modules/signal.js @@ -31,7 +31,6 @@ const { const { ContactDetail, } = require('../../ts/components/conversation/ContactDetail'); -const { ContactListItem } = require('../../ts/components/ContactListItem'); const { ContactModal, } = require('../../ts/components/conversation/ContactModal'); @@ -329,7 +328,6 @@ exports.setup = (options = {}) => { ChatColorPicker, ConfirmationDialog, ContactDetail, - ContactListItem, ContactModal, Emojify, ErrorModal, diff --git a/ts/components/ContactListItem.stories.tsx b/ts/components/ContactListItem.stories.tsx deleted file mode 100644 index 0f218bc7c47b..000000000000 --- a/ts/components/ContactListItem.stories.tsx +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2020-2021 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -import * as React from 'react'; - -import { storiesOf } from '@storybook/react'; -import { action } from '@storybook/addon-actions'; - -import { gifUrl } from '../storybook/Fixtures'; -import { setupI18n } from '../util/setupI18n'; -import enMessages from '../../_locales/en/messages.json'; -import { ContactListItem } from './ContactListItem'; -import { getRandomColor } from '../test-both/helpers/getRandomColor'; - -const i18n = setupI18n('en', enMessages); -const onClick = action('onClick'); - -storiesOf('Components/ContactListItem', module) - .add("It's me!", () => { - return ( - - ); - }) - .add('With name and profile (note vertical spacing)', () => { - return ( -
- - -
- ); - }) - .add('With name and profile, admin', () => { - return ( - - ); - }) - .add('With a group with no avatarPath', () => { - return ( - - ); - }) - .add('With just number, admin', () => { - return ( - - ); - }) - .add('With name and profile, no avatar', () => { - return ( - - ); - }) - .add('Profile, no name, no avatar', () => { - return ( - - ); - }) - .add('No name, no profile, no avatar, no about', () => { - return ( - - ); - }) - .add('No name, no profile, no avatar', () => { - return ( - - ); - }) - .add('No name, no profile, no number', () => { - return ( - - ); - }); diff --git a/ts/components/ContactListItem.tsx b/ts/components/ContactListItem.tsx deleted file mode 100644 index 3acb12857730..000000000000 --- a/ts/components/ContactListItem.tsx +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2018-2021 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -import React from 'react'; -import classNames from 'classnames'; - -import { About } from './conversation/About'; -import { Avatar } from './Avatar'; -import { Emojify } from './conversation/Emojify'; -import { InContactsIcon } from './InContactsIcon'; - -import type { LocalizerType } from '../types/Util'; -import type { ConversationType } from '../state/ducks/conversations'; -import { isInSystemContacts } from '../util/isInSystemContacts'; - -type Props = { - i18n: LocalizerType; - isAdmin?: boolean; - onClick?: () => void; -} & Pick< - ConversationType, - | 'about' - | 'acceptedMessageRequest' - | 'avatarPath' - | 'color' - | 'isMe' - | 'name' - | 'phoneNumber' - | 'profileName' - | 'sharedGroupNames' - | 'title' - | 'type' - | 'unblurredAvatarPath' ->; - -export class ContactListItem extends React.Component { - public renderAvatar(): JSX.Element { - const { - acceptedMessageRequest, - avatarPath, - color, - i18n, - isMe, - name, - phoneNumber, - profileName, - sharedGroupNames, - title, - type, - unblurredAvatarPath, - } = this.props; - - return ( - - ); - } - - public override render(): JSX.Element { - const { about, i18n, isAdmin, isMe, name, onClick, title, type } = - this.props; - - const displayName = isMe ? i18n('you') : title; - - return ( - - ); - } -}