Skip to content

Commit

Permalink
Merge pull request #752 from nyaruka/twitter_handle
Browse files Browse the repository at this point in the history
Add twitter handle scheme back in
  • Loading branch information
ericnewcomer authored Nov 19, 2019
2 parents 81a1af1 + 63d8646 commit 89ab71e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
14 changes: 9 additions & 5 deletions src/components/flow/actions/addurn/AddURN.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ import i18n from 'config/i18n';

export const MAX_TO_SHOW = 3;

const AddURNComp: React.SFC<AddURN> = ({ scheme, path }): JSX.Element => (
<>
{i18n.t('add', 'Add')} {getSchemeObject(scheme).name} {path}
</>
);
const AddURNComp: React.SFC<AddURN> = ({ scheme, path }): JSX.Element => {
const schemeObject = getSchemeObject(scheme);
const schemeName = schemeObject ? schemeObject.name : scheme;
return (
<>
{i18n.t('add', 'Add')} {schemeName} {path}
</>
);
};

export default AddURNComp;
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ exports[`AddURNForm renders 1`] = `
>
Twitter ID
</option>
<option
value="twitter"
>
Twitter Handle
</option>
<option
value="wechat"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ exports[`FieldRouterForm initializes 1`] = `
"name": "Twitter ID",
"type": "scheme",
},
Object {
"id": "twitter",
"name": "Twitter Handle",
"type": "scheme",
},
Object {
"id": "wechat",
"name": "Wechat ID",
Expand Down Expand Up @@ -305,6 +310,11 @@ exports[`FieldRouterForm should render 1`] = `
"name": "Twitter ID",
"type": "scheme",
},
Object {
"id": "twitter",
"name": "Twitter Handle",
"type": "scheme",
},
Object {
"id": "wechat",
"name": "Wechat ID",
Expand Down
3 changes: 2 additions & 1 deletion src/config/i18n/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@
"line": "Line ID",
"phone": "Phone Number",
"telegram": "Telegram ID",
"twitter": "Twitter ID",
"twitter": "Twitter Handle",
"twitterid": "Twitter ID",
"viber": "Viber ID",
"wechat": "Wechat ID",
"whatsapp": "Whatsapp Number"
Expand Down
3 changes: 2 additions & 1 deletion src/config/typeConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export const SCHEMES: Scheme[] = [
{ scheme: 'mailto', name: i18n.t('schemes.email', 'Email Address') },
{ scheme: 'tel', name: i18n.t('schemes.phone', 'Phone Number') },
{ scheme: 'telegram', name: i18n.t('schemes.telegram', 'Telegram ID') },
{ scheme: 'twitterid', name: i18n.t('schemes.twitter', 'Twitter ID') },
{ scheme: 'twitterid', name: i18n.t('schemes.twitterid', 'Twitter ID') },
{ scheme: 'twitter', name: i18n.t('schemes.twitter', 'Twitter Handle') },
{ scheme: 'wechat', name: i18n.t('schemes.wechat', 'Wechat ID') },
{ scheme: 'whatsapp', name: i18n.t('schemes.whatsapp', 'Whatsapp Number') },
{ scheme: 'viber', name: i18n.t('schemes.viber', 'Viber ID') }
Expand Down

0 comments on commit 89ab71e

Please sign in to comment.