From 6431b111fb733edeb368c96bdc88ce6eb26ee2d1 Mon Sep 17 00:00:00 2001 From: Eric Newcomer Date: Tue, 19 Nov 2019 11:54:56 -0800 Subject: [PATCH 1/2] Add twitter handle scheme back in --- src/components/flow/actions/addurn/AddURN.tsx | 14 +++++++++----- src/config/i18n/defaults.json | 3 ++- src/config/typeConfigs.ts | 3 ++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/flow/actions/addurn/AddURN.tsx b/src/components/flow/actions/addurn/AddURN.tsx index 9e49357fb..2845f28d4 100644 --- a/src/components/flow/actions/addurn/AddURN.tsx +++ b/src/components/flow/actions/addurn/AddURN.tsx @@ -6,10 +6,14 @@ import i18n from 'config/i18n'; export const MAX_TO_SHOW = 3; -const AddURNComp: React.SFC = ({ scheme, path }): JSX.Element => ( - <> - {i18n.t('add', 'Add')} {getSchemeObject(scheme).name} {path} - -); +const AddURNComp: React.SFC = ({ scheme, path }): JSX.Element => { + const schemeObject = getSchemeObject(scheme); + const schemeName = schemeObject ? schemeObject.name : scheme; + return ( + <> + {i18n.t('add', 'Add')} {schemeName} {path} + + ); +}; export default AddURNComp; diff --git a/src/config/i18n/defaults.json b/src/config/i18n/defaults.json index 97918680e..3f5e828b3 100644 --- a/src/config/i18n/defaults.json +++ b/src/config/i18n/defaults.json @@ -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" diff --git a/src/config/typeConfigs.ts b/src/config/typeConfigs.ts index ad355015d..f10b0e971 100644 --- a/src/config/typeConfigs.ts +++ b/src/config/typeConfigs.ts @@ -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') } From 63d86460353aec96dcc80ab7fe8fdcd5d15eb8b8 Mon Sep 17 00:00:00 2001 From: Eric Newcomer Date: Tue, 19 Nov 2019 12:00:03 -0800 Subject: [PATCH 2/2] Update snapshots --- .../addurn/__snapshots__/AddURNForm.test.tsx.snap | 5 +++++ .../field/__snapshots__/FieldRouterForm.test.ts.snap | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/components/flow/actions/addurn/__snapshots__/AddURNForm.test.tsx.snap b/src/components/flow/actions/addurn/__snapshots__/AddURNForm.test.tsx.snap index 5274361af..0b3557f6b 100644 --- a/src/components/flow/actions/addurn/__snapshots__/AddURNForm.test.tsx.snap +++ b/src/components/flow/actions/addurn/__snapshots__/AddURNForm.test.tsx.snap @@ -202,6 +202,11 @@ exports[`AddURNForm renders 1`] = ` > Twitter ID +