#305: fix flow annotations and naming for linkByOs

This commit is contained in:
SleepWalker 2017-08-04 22:36:43 +03:00
parent f5c1ef4217
commit 629a96dc16

View File

@ -8,10 +8,15 @@ import styles from './instructions.scss';
type OS = 'android'|'ios'|'windows'; type OS = 'android'|'ios'|'windows';
const linksByOs: {[key: OS]: Array<{link: string, label: string}>} = { const linksByOs: {
[key: OS]: {
searchLink: string,
featured: Array<{link: string, label: string}>
}
} = {
android: { android: {
storeSearch: 'https://play.google.com/store/search?q=totp%20authenticator', searchLink: 'https://play.google.com/store/search?q=totp%20authenticator',
recommendations: [ featured: [
{ {
link: 'https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2', link: 'https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2',
label: 'Google Authenticator', label: 'Google Authenticator',
@ -27,8 +32,8 @@ const linksByOs: {[key: OS]: Array<{link: string, label: string}>} = {
], ],
}, },
ios: { ios: {
storeSearch: 'https://linkmaker.itunes.apple.com/en-us?mediaType=ios_apps&term=authenticator', searchLink: 'https://linkmaker.itunes.apple.com/en-us?mediaType=ios_apps&term=authenticator',
recommendations: [ featured: [
{ {
link: 'https://itunes.apple.com/ru/app/google-authenticator/id388497605', link: 'https://itunes.apple.com/ru/app/google-authenticator/id388497605',
label: 'Google Authenticator', label: 'Google Authenticator',
@ -44,8 +49,8 @@ const linksByOs: {[key: OS]: Array<{link: string, label: string}>} = {
], ],
}, },
windows: { windows: {
storeSearch: 'https://www.microsoft.com/be-by/store/search/apps?devicetype=mobile&q=authenticator', searchLink: 'https://www.microsoft.com/be-by/store/search/apps?devicetype=mobile&q=authenticator',
recommendations: [ featured: [
{ {
link: 'https://www.microsoft.com/en-us/store/p/microsoft-authenticator/9nblgggzmcj6', link: 'https://www.microsoft.com/en-us/store/p/microsoft-authenticator/9nblgggzmcj6',
label: 'Microsoft Authenticator', label: 'Microsoft Authenticator',
@ -74,7 +79,7 @@ export default function OsInstruction({
</h3> </h3>
<ul className={styles.appList}> <ul className={styles.appList}>
{linksByOs[os].recommendations.map((item) => ( {linksByOs[os].featured.map((item) => (
<li key={item.label}> <li key={item.label}>
<a href={item.link} target="_blank"> <a href={item.link} target="_blank">
{item.label} {item.label}
@ -84,7 +89,7 @@ export default function OsInstruction({
</ul> </ul>
<div className={styles.otherApps}> <div className={styles.otherApps}>
<a href={linksByOs[os].storeSearch} target="_blank"> <a href={linksByOs[os].searchLink} target="_blank">
<Message {...messages.findAlternativeApps} /> <Message {...messages.findAlternativeApps} />
</a> </a>
</div> </div>