-
Notifications
You must be signed in to change notification settings - Fork 295
/
AppStore.tsx
64 lines (60 loc) · 1.9 KB
/
AppStore.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// @flow
import React from 'react';
import { injectIntl } from 'react-intl';
import SVGInline from 'react-svg-inline';
import QRCode from 'qrcode.react';
import downloadAppStoreIcon from '../../../assets/images/voting/download-app-store-icon-ic.inline.svg';
import downloadPlayStoreIcon from '../../../assets/images/voting/download-play-store-icon-ic.inline.svg';
import type { Intl } from '../../../types/i18nTypes';
import styles from './AppStore.scss';
import { messages } from './AppStore.messages';
type Props = {
onAppleStoreLinkClick: Function,
onAndroidStoreLinkClick: Function,
intl: Intl,
};
function AppStore({
onAppleStoreLinkClick,
onAndroidStoreLinkClick,
intl,
}: Props) {
const appleAppButtonUrl = intl.formatMessage(messages.appleAppButtonUrl);
const androidAppButtonUrl = intl.formatMessage(messages.androidAppButtonUrl);
return (
<div className={styles.component}>
<div className={styles.appStoreItem}>
<button
className={styles.appStoreButton}
onClick={() => {
onAppleStoreLinkClick(appleAppButtonUrl);
}}
>
<SVGInline
svg={downloadAppStoreIcon}
className={styles.appleStoreIcon}
/>
</button>
<div className={styles.qrCode}>
<QRCode value={appleAppButtonUrl} size={75} renderAs="svg" />
</div>
</div>
<div className={styles.appStoreItem}>
<button
className={styles.appStoreButton}
onClick={() => {
onAndroidStoreLinkClick(androidAppButtonUrl);
}}
>
<SVGInline
svg={downloadPlayStoreIcon}
className={styles.playStoreIcon}
/>
</button>
<div className={styles.qrCode}>
<QRCode value={androidAppButtonUrl} size={75} renderAs="svg" />
</div>
</div>
</div>
);
}
export default injectIntl(AppStore);