-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emojification now all done with react via a few new components
Three locations were changed: 1. a group update, which lists a set of contacts 2. the contact name in the left pane 3. the conversation title Three new components were added to window.Signal.Components to support these scenarios, respectively: 1. Emojify 2. ContactName 3. ConversationTitle Note that there are a number of other places in the app that should be emojified, but never have been before. Essentially any place that a contact name might be shown. A non-exhaustive list: - Show group members - Show safety number - Verified change notification - Disappearing timer change notification - Contact verification notification - Quote contact name
- Loading branch information
1 parent
d9e5338
commit 548c8e6
Showing
10 changed files
with
152 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
|
||
import { Emojify } from './Emojify'; | ||
|
||
interface Props { | ||
phoneNumber: string; | ||
name?: string; | ||
profileName?: string; | ||
} | ||
|
||
export class ContactName extends React.Component<Props, {}> { | ||
public render() { | ||
const { phoneNumber, name, profileName } = this.props; | ||
|
||
const title = name ? name : phoneNumber; | ||
const profileElement = | ||
profileName && !name ? ( | ||
<span className="profile-name"> | ||
~<Emojify text={profileName} /> | ||
</span> | ||
) : null; | ||
|
||
return ( | ||
<span> | ||
<Emojify text={title} /> {profileElement} | ||
</span> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
|
||
import { Emojify } from './Emojify'; | ||
import { Localizer } from '../../types/Util'; | ||
|
||
interface Props { | ||
i18n: Localizer; | ||
isVerified: boolean; | ||
name?: string; | ||
phoneNumber: string; | ||
profileName?: string; | ||
} | ||
|
||
export class ConversationTitle extends React.Component<Props, {}> { | ||
public render() { | ||
const { name, phoneNumber, i18n, profileName, isVerified } = this.props; | ||
|
||
return ( | ||
<span className="conversation-title"> | ||
{name ? ( | ||
<span className="conversation-name" dir="auto"> | ||
<Emojify text={name} /> | ||
</span> | ||
) : null} | ||
{phoneNumber ? ( | ||
<span className="conversation-number">{phoneNumber}</span> | ||
) : null}{' '} | ||
{profileName ? ( | ||
<span className="profileName"> | ||
<Emojify text={profileName} /> | ||
</span> | ||
) : null} | ||
{isVerified ? ( | ||
<span className="verified"> | ||
<span className="verified-icon" /> | ||
{i18n('verified')} | ||
</span> | ||
) : null} | ||
</span> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters