@basiq/connect-auth 0.1.78 → 0.1.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +159 -1
  3. package/dist/App.d.ts +3 -0
  4. package/dist/BasiqConnect.d.ts +3 -0
  5. package/dist/actions/actions.d.ts +22 -0
  6. package/dist/components/modals/LoadingModal.d.ts +8 -0
  7. package/dist/components/modals/index.d.ts +1 -0
  8. package/dist/components/pages/AuthScreen.d.ts +9 -0
  9. package/dist/components/pages/NotFound.d.ts +6 -0
  10. package/dist/components/pages/Page.d.ts +18 -0
  11. package/dist/components/pages/StartScreen.d.ts +10 -0
  12. package/dist/components/pages/index.d.ts +4 -0
  13. package/dist/components/ui/Button.d.ts +10 -0
  14. package/dist/components/ui/Modal.d.ts +9 -0
  15. package/dist/components/ui/icon.d.ts +7 -0
  16. package/dist/components/ui/index.d.ts +1 -0
  17. package/dist/connect-auth.cjs.development.js +1494 -0
  18. package/dist/connect-auth.cjs.development.js.map +1 -0
  19. package/dist/connect-auth.cjs.production.min.js +2 -0
  20. package/dist/connect-auth.cjs.production.min.js.map +1 -0
  21. package/dist/connect-auth.esm.js +1486 -0
  22. package/dist/connect-auth.esm.js.map +1 -0
  23. package/dist/helpers/constants.d.ts +1 -0
  24. package/dist/helpers/hookUtils.d.ts +2 -0
  25. package/dist/helpers/index.d.ts +3 -0
  26. package/dist/helpers/utils.d.ts +3 -0
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.js +8 -0
  29. package/dist/locales/i18n.d.ts +36 -0
  30. package/dist/setupTests.d.ts +1 -0
  31. package/dist/styledComponents/base.d.ts +4 -0
  32. package/dist/styledComponents/breakpoints.d.ts +15 -0
  33. package/dist/styledComponents/index.d.ts +4 -0
  34. package/dist/styledComponents/pages/auth.d.ts +10 -0
  35. package/dist/styledComponents/pages/basic.d.ts +23 -0
  36. package/dist/styledComponents/pages/index.d.ts +4 -0
  37. package/dist/styledComponents/pages/notFound.d.ts +9 -0
  38. package/dist/styledComponents/pages/start.d.ts +1 -0
  39. package/dist/styledComponents/styles.d.ts +2 -0
  40. package/dist/styledComponents/theme.d.ts +45 -0
  41. package/dist/styledComponents/ui/basic.d.ts +10 -0
  42. package/dist/styledComponents/ui/button.d.ts +9 -0
  43. package/dist/styledComponents/ui/index.d.ts +3 -0
  44. package/dist/styledComponents/ui/modals.d.ts +7 -0
  45. package/package.json +55 -85
  46. package/src/App.tsx +96 -0
  47. package/src/BasiqConnect.tsx +17 -0
  48. package/src/actions/actions.ts +72 -0
  49. package/src/components/modals/LoadingModal.tsx +28 -0
  50. package/src/components/modals/index.ts +1 -0
  51. package/src/components/pages/AuthScreen.tsx +96 -0
  52. package/src/components/pages/NotFound.tsx +44 -0
  53. package/src/components/pages/Page.tsx +46 -0
  54. package/src/components/pages/StartScreen.tsx +83 -0
  55. package/src/components/pages/index.ts +4 -0
  56. package/src/components/ui/Button.tsx +24 -0
  57. package/src/components/ui/Modal.tsx +29 -0
  58. package/src/components/ui/icon.tsx +18 -0
  59. package/src/components/ui/index.ts +1 -0
  60. package/src/custom.d.ts +9 -0
  61. package/{build/static/media/Mark-W1G-Bold.25001c0659b6d43e86d2.otf → src/fonts/Mark-W1G-Bold.otf} +0 -0
  62. package/{build/static/media/Mark-W1G-Book.9763eea8f13903a47362.otf → src/fonts/Mark-W1G-Book.otf} +0 -0
  63. package/src/fonts.d.ts +1 -0
  64. package/src/helpers/constants.ts +2 -0
  65. package/src/helpers/hookUtils.ts +8 -0
  66. package/src/helpers/index.ts +3 -0
  67. package/src/helpers/utils.ts +12 -0
  68. package/{build/static/media/back.3e5461de3426c624c329c95f21e691e9.svg → src/images/back.svg} +0 -0
  69. package/{build/static/media/error.ba856527ba47d8c7cf94aa10a4ff4e33.svg → src/images/error.svg} +0 -0
  70. package/{build/static/media/loading_indicator.0de376bea3ef05218f67099d42c6e7f7.svg → src/images/loading_indicator.svg} +0 -0
  71. package/src/index.tsx +1 -0
  72. package/src/locales/en/translation.json +29 -0
  73. package/src/locales/i18n.ts +27 -0
  74. package/src/logo.svg +1 -0
  75. package/src/react-app-env.d.ts +1 -0
  76. package/src/react-i18next.d.ts +9 -0
  77. package/src/setupTests.ts +5 -0
  78. package/src/styled.d.ts +6 -0
  79. package/src/styledComponents/base.ts +73 -0
  80. package/src/styledComponents/breakpoints.ts +32 -0
  81. package/src/styledComponents/index.ts +4 -0
  82. package/src/styledComponents/pages/auth.ts +49 -0
  83. package/src/styledComponents/pages/basic.ts +126 -0
  84. package/src/styledComponents/pages/index.ts +4 -0
  85. package/src/styledComponents/pages/notFound.ts +70 -0
  86. package/src/styledComponents/pages/start.ts +6 -0
  87. package/src/styledComponents/styles.ts +25 -0
  88. package/src/styledComponents/theme.ts +58 -0
  89. package/src/styledComponents/ui/basic.ts +96 -0
  90. package/src/styledComponents/ui/button.ts +112 -0
  91. package/src/styledComponents/ui/index.ts +3 -0
  92. package/src/styledComponents/ui/modals.ts +48 -0
  93. package/.idea/connect-code-validaiton.iml +0 -8
  94. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  95. package/.idea/jsLinters/eslint.xml +0 -6
  96. package/.idea/modules.xml +0 -8
  97. package/.idea/vcs.xml +0 -6
  98. package/build/asset-manifest.json +0 -15
  99. package/build/favicon.ico +0 -0
  100. package/build/index.html +0 -1
  101. package/build/logo192.png +0 -0
  102. package/build/logo512.png +0 -0
  103. package/build/manifest.json +0 -25
  104. package/build/robots.txt +0 -3
  105. package/build/static/js/main.308297e7.js +0 -3
  106. package/build/static/js/main.308297e7.js.LICENSE.txt +0 -38
  107. package/build/static/js/main.308297e7.js.map +0 -1
  108. package/tsconfig.json +0 -21
@@ -0,0 +1,96 @@
1
+ import React, { ChangeEvent, useState } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import Page, { IButton } from './Page';
4
+ import { DivAsLink, InputContainer, InputStyled, PageConnectFooterControl, PageConnectFooterText, StatusMessage } from '../../styledComponents';
5
+ import { InnerContainer } from '../../styledComponents/pages/start';
6
+ import { LoadingModal } from '../modals';
7
+ import { authUser, verifySmsCode } from '../../actions/actions';
8
+
9
+ interface IProps {
10
+ shadow: boolean;
11
+ onBack: () => void;
12
+ number: string;
13
+ authId: string;
14
+ }
15
+
16
+ function AuthScreen({ onBack, number, authId, shadow }: IProps) {
17
+ const { t } = useTranslation();
18
+ const [error, setError] = useState('');
19
+ const [code, setCode] = useState('');
20
+ const [resend, setResend] = useState(false);
21
+ const [loading, setLoading] = useState(false);
22
+ const handleCodeApply = async () => {
23
+ setLoading(true);
24
+ const response = await verifySmsCode(authId, code);
25
+ setLoading(false);
26
+ if (response?.data?.access_token) {
27
+ window.open(`https://consent.basiq.io/home?token=${response?.data?.access_token}`);
28
+ }
29
+ if (response?.error) {
30
+ setError(t('this_code_doesnt_appear_to_be_valid'));
31
+ }
32
+ };
33
+ const buttons: IButton[] = [
34
+ {
35
+ label: t('continue'),
36
+ onClick: () => handleCodeApply()
37
+ }
38
+ ];
39
+
40
+ const handleResend = async () => {
41
+ setError('');
42
+ setCode('');
43
+ setLoading(true);
44
+ const response = await authUser(authId);
45
+ setLoading(false);
46
+ if (response.error) {
47
+ setError(t('failed_to_send_sms'));
48
+ } else {
49
+ setResend(true);
50
+ }
51
+ };
52
+ const handleInput = (e: ChangeEvent<HTMLInputElement>) => {
53
+ setError('');
54
+ setResend(false);
55
+ setCode(e.target.value);
56
+ };
57
+ return (
58
+ <Page
59
+ title={t('verify_your_mobile_number')}
60
+ subTitle={t('please_enter_the_sms_code_sent_to_your_mobile_number', { number })}
61
+ shadow={shadow}
62
+ buttons={buttons}
63
+ onBack={onBack}
64
+ >
65
+ <InnerContainer>
66
+ <InputContainer>
67
+ <InputStyled
68
+ pattern="\d{4}"
69
+ inputMode="numeric"
70
+ autoComplete="one-time-code"
71
+ type="text"
72
+ maxLength={4}
73
+ onChange={handleInput}
74
+ value={code}
75
+ filled={code.length === 4}
76
+ error={!!error}
77
+ />
78
+ </InputContainer>
79
+ <PageConnectFooterControl>
80
+ {resend && <StatusMessage>{t<string>('new_sms_code_has_been_sent')}</StatusMessage>}
81
+ {!!error && <StatusMessage error>{error}</StatusMessage>}
82
+ <PageConnectFooterText>
83
+ <span>
84
+ <>
85
+ {t('didnt_receive_the_code')} <DivAsLink onClick={() => handleResend()}>{t<string>('resend_sms')}</DivAsLink>
86
+ </>
87
+ </span>
88
+ </PageConnectFooterText>
89
+ </PageConnectFooterControl>
90
+ <LoadingModal isOpen={loading} />
91
+ </InnerContainer>
92
+ </Page>
93
+ );
94
+ }
95
+
96
+ export default AuthScreen;
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import {
4
+ PageControlsSection,
5
+ PageShadowWrapper,
6
+ PageStatusScreenContent,
7
+ PageStatusScreenMain,
8
+ PageStyled,
9
+ StatusScreenCircleContainer,
10
+ StatusScreenErrorCode
11
+ } from '../../styledComponents';
12
+ import Icon from '../ui/icon';
13
+ import Page from './Page';
14
+ import err from '../../images/error.svg';
15
+
16
+ interface IProps {
17
+ messageCode?: string;
18
+ }
19
+
20
+ function NotFound({ messageCode = '404' }: IProps) {
21
+ const { t } = useTranslation();
22
+ return (
23
+ <Page shadow={false}>
24
+ <PageStyled>
25
+ <PageStatusScreenMain>
26
+ <PageStyled>
27
+ <PageStatusScreenContent>
28
+ <StatusScreenCircleContainer type="warning">
29
+ <Icon img={err} rotating={false} />
30
+ </StatusScreenCircleContainer>
31
+ <span>{t<string>('page_not_found')}</span>
32
+ <StatusScreenErrorCode>{`${t('error')}: ${messageCode}`}</StatusScreenErrorCode>
33
+ </PageStatusScreenContent>
34
+ </PageStyled>
35
+ </PageStatusScreenMain>
36
+ <PageControlsSection notEmpty={false}>
37
+ <PageShadowWrapper />
38
+ </PageControlsSection>
39
+ </PageStyled>
40
+ </Page>
41
+ );
42
+ }
43
+
44
+ export default NotFound;
@@ -0,0 +1,46 @@
1
+ import React, { ReactElement } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { Button } from '../ui';
4
+ import { PageControlsSection, PageMainContainer, PageShadow, PageShadowWrapper, PageStyled, PageSubtitle } from '../../styledComponents';
5
+ import { ButtonType } from '../ui/Button';
6
+
7
+ interface IProps {
8
+ buttons?: IButton[];
9
+ children: ReactElement;
10
+ title?: string | ReactElement;
11
+ subTitle?: string;
12
+ shadow: boolean;
13
+ onBack?: () => void;
14
+ }
15
+
16
+ export interface IButton {
17
+ label: string;
18
+ onClick: () => void;
19
+ buttonType?: ButtonType;
20
+ disabled?: boolean;
21
+ }
22
+
23
+ function Page(props: IProps) {
24
+ const { buttons, children, title, subTitle, shadow, onBack } = props;
25
+
26
+ const { t } = useTranslation();
27
+
28
+ return (
29
+ <PageStyled buttonCount={buttons?.length}>
30
+ {onBack && <Button onClick={onBack} label={t('back')} buttonType="back" />}
31
+ {title && <h3>{title}</h3>}
32
+ {subTitle && <PageSubtitle>{subTitle}</PageSubtitle>}
33
+ <PageMainContainer>{children}</PageMainContainer>
34
+ <PageControlsSection notEmpty={(buttons?.length ?? 0) > 0}>
35
+ <PageShadowWrapper>
36
+ {shadow && <PageShadow />}
37
+ {buttons?.map((b, index) => (
38
+ <Button key={index} onClick={b.onClick} label={b.label} buttonType={b.buttonType} disabled={b.disabled} />
39
+ ))}
40
+ </PageShadowWrapper>
41
+ </PageControlsSection>
42
+ </PageStyled>
43
+ );
44
+ }
45
+
46
+ export default Page;
@@ -0,0 +1,83 @@
1
+ import React, { useState } from 'react';
2
+ import { Trans, useTranslation } from 'react-i18next';
3
+ import Page, { IButton } from './Page';
4
+ import { H4Styled, Spacer, InnerContainer } from '../../styledComponents';
5
+ import { authUser } from '../../actions/actions';
6
+ import { LoadingModal } from '../modals';
7
+
8
+ interface IProps {
9
+ onContinue: () => void;
10
+ showErrorScreen: (code:string) => void;
11
+ shadow: boolean;
12
+ appName: string;
13
+ authId?: string;
14
+ }
15
+
16
+ function StartScreen(props: IProps) {
17
+ const { onContinue, appName, shadow, authId } = props;
18
+ const [loading, setLoading] = useState(false);
19
+ const { t } = useTranslation();
20
+ const handleContinue = async () => {
21
+ setLoading(true);
22
+ if(!!authId){
23
+ const response = await authUser(authId);
24
+ if (response?.data?.status === 'code-sent') {
25
+ setLoading(false);
26
+ onContinue();
27
+ }
28
+ }
29
+
30
+ };
31
+ const buttons: IButton[] = [
32
+ {
33
+ label: t('continue'),
34
+ onClick: () => handleContinue()
35
+ }
36
+ ];
37
+ return (
38
+ <Page
39
+ title={
40
+ appName ? (
41
+ <Trans t={t} i18nKey="use_basiq_to_connect_your_accounts" values={{ name: appName }} components={{ bold: <strong /> }} />
42
+ ) : (
43
+ <Trans t={t} i18nKey="we_use_basiq_to_connect_your_accounts" components={{ bold: <strong /> }} />
44
+ )
45
+ }
46
+ shadow={shadow}
47
+ buttons={buttons}
48
+ >
49
+ <InnerContainer>
50
+ <Spacer />
51
+ <H4Styled>{t<string>('to_do_this_we_will_ask_you_to')}</H4Styled>
52
+ <ul>
53
+ <li>
54
+ <Trans t={t} i18nKey="verify_your_mobile_number_bold" components={{ bold: <strong /> }} />
55
+ </li>
56
+ <li>
57
+ <Trans t={t} i18nKey="consent_to_share_your_data_with_us" components={{ bold: <strong /> }} />
58
+ </li>
59
+ <li>
60
+ <Trans t={t} i18nKey="share_your_financial_data" components={{ bold: <strong /> }} />
61
+ </li>
62
+ </ul>
63
+ <H4Styled>{t<string>('things_you_should_know')}</H4Styled>
64
+ <ul>
65
+ <li>{t<string>('we_dont_share_your_data_without_your_consent')}</li>
66
+ <li>{t<string>('you_can_easily_stop_sharing_your_data_at_any_time')}</li>
67
+ <li>{t<string>('you_can_choose_to_delete_shared_data_when_we_no_longer_need_it')}</li>
68
+ </ul>
69
+ <Spacer />
70
+ <span>
71
+ <>
72
+ {t('by_proceeding_you_agree_to_the')}{' '}
73
+ <a href="https://docs.basiq.io/en/articles/415750-basiq-terms-of-service">{t<string>('terms_of_service')}</a> {t('and')}{' '}
74
+ <a href="https://docs.basiq.io/en/articles/382581-basiq-privacy-policy">{t<string>('privacy_notice')}</a>
75
+ </>
76
+ </span>
77
+ <LoadingModal isOpen={loading} />
78
+ </InnerContainer>
79
+ </Page>
80
+ );
81
+ }
82
+
83
+ export default StartScreen;
@@ -0,0 +1,4 @@
1
+ export { default as Page } from './Page';
2
+ export { default as NotFound } from './NotFound';
3
+ export { default as StartScreen } from './StartScreen';
4
+ export { default as AuthScreen } from './AuthScreen';
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { ButtonLabel, ButtonStyled } from '../../styledComponents';
3
+ import back from '../../images/back.svg';
4
+
5
+ export type ButtonType = 'secondary' | 'tiny' | 'link' | 'back';
6
+
7
+ interface Props {
8
+ onClick: () => void;
9
+ label: string;
10
+ buttonType?: ButtonType;
11
+ disabled?: boolean;
12
+ }
13
+
14
+ function Button(props: Props) {
15
+ const { onClick, label, buttonType, disabled } = props;
16
+ return (
17
+ <ButtonStyled buttonType={buttonType} disabled={disabled || false} onClick={onClick}>
18
+ {buttonType === 'back' && <img src={back} alt="" />}
19
+ <ButtonLabel> {label || ''}</ButtonLabel>
20
+ </ButtonStyled>
21
+ );
22
+ }
23
+
24
+ export default Button;
@@ -0,0 +1,29 @@
1
+ import React, { ReactElement, SyntheticEvent } from 'react';
2
+ import { ModalStyled } from '../../styledComponents';
3
+
4
+ interface IProps {
5
+ children: ReactElement;
6
+ onClose?: () => void;
7
+ isOpen: boolean;
8
+ disableTransparency: boolean;
9
+ }
10
+
11
+ function Modal(props: IProps) {
12
+ const { children, onClose, isOpen, disableTransparency } = props;
13
+ const handleOutsideClick = (e: SyntheticEvent<HTMLElement>) => {
14
+ if (onClose && (e.target as HTMLElement).id === 'ui-modal') {
15
+ onClose();
16
+ }
17
+ };
18
+ return (
19
+ <>
20
+ {isOpen ? (
21
+ <ModalStyled id="ui-modal" disableTransparency={disableTransparency} onClick={handleOutsideClick}>
22
+ {children}
23
+ </ModalStyled>
24
+ ) : null}
25
+ </>
26
+ );
27
+ }
28
+
29
+ export default Modal;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { IconWrapper } from '../../styledComponents';
3
+
4
+ interface IProps {
5
+ rotating: boolean;
6
+ img: string;
7
+ }
8
+
9
+ function Icon(props: IProps) {
10
+ const { rotating, img } = props;
11
+ return (
12
+ <IconWrapper rotating={rotating}>
13
+ <img src={img} alt="" />
14
+ </IconWrapper>
15
+ );
16
+ }
17
+
18
+ export default Icon;
@@ -0,0 +1 @@
1
+ export { default as Button } from './Button';
@@ -0,0 +1,9 @@
1
+ declare module '*.svg?inline' {
2
+ const content: any
3
+ export default content
4
+ }
5
+
6
+ declare module '*.svg' {
7
+ const content: any
8
+ export default content
9
+ }
package/src/fonts.d.ts ADDED
@@ -0,0 +1 @@
1
+ declare module '*.otf';
@@ -0,0 +1,2 @@
1
+ // export const DASHBOARD_API_URL = 'https://c9joivz12f.execute-api.ap-southeast-2.amazonaws.com/Development/';
2
+ export const DASHBOARD_API_URL = 'https://p4c8zn20r9.execute-api.ap-southeast-2.amazonaws.com/Production_v1/';
@@ -0,0 +1,8 @@
1
+ import { useRef } from 'react';
2
+
3
+ export const useFocus = () => {
4
+ const htmlElRef = useRef<HTMLInputElement>(null);
5
+ const setFocus = () => htmlElRef.current && htmlElRef.current.focus();
6
+
7
+ return [htmlElRef, setFocus];
8
+ };
@@ -0,0 +1,3 @@
1
+ export * from './hookUtils';
2
+ export * from './utils';
3
+ export * from './constants';
@@ -0,0 +1,12 @@
1
+ import { SyntheticEvent } from 'react';
2
+
3
+ export function detectScrollToBottom(event: SyntheticEvent<HTMLDivElement>) {
4
+ const { scrollHeight, scrollTop, clientHeight } = event.currentTarget;
5
+ return scrollHeight - scrollTop > clientHeight;
6
+ }
7
+
8
+ export const hexToRGBa = (hex: string, opacity: number) => {
9
+ const hexToRGBA = hex.match(/[A-Za-z0-9]{2}/g)?.map((v) => parseInt(v, 16));
10
+ const opp = opacity > 1 && opacity < 0 ? 1 : opacity;
11
+ return `rgba(${hexToRGBA?.concat(opp).join()})`;
12
+ };
package/src/index.tsx ADDED
@@ -0,0 +1 @@
1
+ export {BasiqConnect} from './BasiqConnect'
@@ -0,0 +1,29 @@
1
+ {
2
+ "back": "Back",
3
+ "error": "Error",
4
+ "loading": "Loading",
5
+ "continue": "Continue",
6
+ "to_do_this_we_will_ask_you_to": "To do this we will ask you to",
7
+ "verify_your_mobile_number_bold": "<strong>Verify</strong> your mobile number",
8
+ "verify_your_mobile_number": "Verify your mobile number",
9
+ "consent_to_share_your_data_with_us": "<strong>Consent</strong> to share your data with us",
10
+ "share_your_financial_data": "<strong>Share</strong> your financial data",
11
+ "things_you_should_know": "Things you should know",
12
+ "we_dont_share_your_data_without_your_consent": "We don’t share your data without your consent",
13
+ "you_can_easily_stop_sharing_your_data_at_any_time": "You can easily stop sharing your data at any time",
14
+ "you_can_choose_to_delete_shared_data_when_we_no_longer_need_it": "You can choose to delete shared data when we no longer need it",
15
+ "by_proceeding_you_agree_to_the": "By proceeding, you agree to the",
16
+ "terms_of_service": "Terms of service",
17
+ "privacy_notice": "Privacy notice",
18
+ "and": "and",
19
+ "use_basiq_to_connect_your_accounts": "${name} use <strong>Basiq</strong> to connect your accounts",
20
+ "we_use_basiq_to_connect_your_accounts": "We use <strong>Basiq</strong> to connect your accounts",
21
+ "please_enter_the_sms_code_sent_to_your_mobile_number": "Please enter the SMS code sent to your mobile number (ending in xxx${number}).",
22
+ "new_sms_code_has_been_sent": "New SMS code has been sent.",
23
+ "this_code_doesnt_appear_to_be_valid": "This code doesn't appear to be valid.",
24
+ "didnt_receive_the_code": "Didn’t receive the code?",
25
+ "resend_sms": "Resend SMS",
26
+ "failed_to_send_sms": "Failed to send SMS.",
27
+ "page_not_found": "Page not found",
28
+ "missing_authentication_token": "Missing Authentication Token"
29
+ }
@@ -0,0 +1,27 @@
1
+ import i18n from 'i18next';
2
+ import { initReactI18next } from 'react-i18next';
3
+
4
+ import translationEN from './en/translation.json';
5
+
6
+ export const defaultNS = 'ns1';
7
+
8
+ // the translations
9
+ export const resources = {
10
+ en: {
11
+ ns1: translationEN
12
+ }
13
+ } as const;
14
+
15
+ i18n.use(initReactI18next) // passes i18n down to react-i18next
16
+ .init({
17
+ resources,
18
+ lng: 'en',
19
+ ns: ['ns1'],
20
+ interpolation: {
21
+ escapeValue: false, // react already safes from xss
22
+ prefix: '${',
23
+ suffix: '}'
24
+ }
25
+ });
26
+
27
+ export default i18n;
package/src/logo.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
@@ -0,0 +1 @@
1
+ /// <reference types="react-scripts" />
@@ -0,0 +1,9 @@
1
+ import { resources, defaultNS } from './locales/i18n';
2
+
3
+ // react-i18next versions higher than 11.11.0
4
+ declare module 'react-i18next' {
5
+ interface CustomTypeOptions {
6
+ defaultNS: typeof defaultNS;
7
+ resources: typeof resources['en'];
8
+ }
9
+ }
@@ -0,0 +1,5 @@
1
+ // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
+ // allows you to do things like:
3
+ // expect(element).toHaveTextContent(/react/i)
4
+ // learn more: https://github.com/testing-library/jest-dom
5
+ import '@testing-library/jest-dom';
@@ -0,0 +1,6 @@
1
+ import 'styled-components';
2
+ import { ThemeType } from './styledComponents';
3
+
4
+ declare module 'styled-components' {
5
+ export interface DefaultTheme extends ThemeType {}
6
+ }
@@ -0,0 +1,73 @@
1
+ import styled from 'styled-components';
2
+ import { devices } from './breakpoints';
3
+
4
+ export const Root = styled.div`
5
+ white-space: pre-line;
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ position: fixed;
10
+ top: 50%;
11
+ left: 0;
12
+ right: 0;
13
+ transform: translate(0, -50%);
14
+ height: 100%;
15
+ max-height: 812px;
16
+
17
+ a {
18
+ text-decoration: none;
19
+ color: ${({ theme }) => theme.color.endeavour};
20
+ }
21
+ h3 {
22
+ font-weight: normal;
23
+ ${({ theme }) => theme.mixin.title()};
24
+ strong {
25
+ ${({ theme }) => theme.mixin.title()};
26
+ }
27
+ }
28
+ ${devices.phone} {
29
+ width: 100%;
30
+ height: 100%;
31
+ max-height: none;
32
+ padding: 0;
33
+ }
34
+ `;
35
+ export const AppContainer = styled.div`
36
+ width: 539px;
37
+ background-color: ${({ theme }) => theme.color.white};
38
+ display: flex;
39
+ flex-direction: column;
40
+ align-items: center;
41
+ padding: 16px;
42
+ box-sizing: border-box;
43
+ height: 100%;
44
+
45
+ ${devices.phone} {
46
+ width: 100%;
47
+ }
48
+
49
+ &::-webkit-scrollbar {
50
+ display: none;
51
+ }
52
+ -ms-overflow-style: none;
53
+ scrollbar-width: none;
54
+ overflow-y: scroll;
55
+ `;
56
+ export const AppContainerWrapper = styled.div`
57
+ height: 100%;
58
+ position: relative;
59
+ border: 1px solid ${({ theme }) => theme.color.porcelain};
60
+ border-radius: 8px;
61
+ overflow: hidden;
62
+ ${devices.phone} {
63
+ width: 100%;
64
+ border-radius: unset;
65
+ border: unset;
66
+ }
67
+ `;
68
+ export const AppContainerPage = styled.div`
69
+ width: 100%;
70
+ display: flex;
71
+ flex-direction: column;
72
+ align-items: center;
73
+ `;
@@ -0,0 +1,32 @@
1
+ const breakpoints = {
2
+ mobileS: '320px',
3
+ mobileL: '480px',
4
+ tabletMinus: '767px',
5
+ tabletH: '781px',
6
+ tablet: '768px',
7
+ tabletL: '992px',
8
+ laptop: '1024px',
9
+ laptopH: '1080px',
10
+ laptopXS: '1110px',
11
+ laptopS: '1280px',
12
+ laptopM: '1366px',
13
+ laptopL: '1440px',
14
+ laptopXL: '1540px',
15
+ desktopS: '1800px',
16
+ desktop: '2560px'
17
+ };
18
+ export const devices = {
19
+ fold: `@media only screen and (max-width: ${breakpoints.mobileS})`,
20
+ phoneXs: `@media only screen and (max-width: ${breakpoints.mobileL})`,
21
+ phone: `@media only screen and (max-width: ${breakpoints.tabletMinus})`,
22
+ phoneLandscape: `@media only screen and (max-width: ${breakpoints.mobileL})`,
23
+ tabletOnly: `@media only screen and (min-width: ${breakpoints.tablet}) and (max-width: ${breakpoints.tabletL})`,
24
+ iPadProLandscape: `@media only screen and (height: ${breakpoints.laptop}) and (width: ${breakpoints.laptopM})`,
25
+ iPadProPortrait: `@media only screen and (max-width: ${breakpoints.laptop}) and (max-height: ${breakpoints.laptopM})`,
26
+ iPad: `@media only screen and (max-width: ${breakpoints.laptop}) and (max-height: ${breakpoints.tablet}) `,
27
+ tablet: `@media only screen and (max-width: ${breakpoints.tabletL}) `,
28
+ desktop: `@media only screen and (min-height: ${breakpoints.tabletH} ) and (min-width: ${breakpoints.laptopS} ) `,
29
+ laptop: `@media only screen and (max-width: ${breakpoints.laptopS}) `,
30
+ laptopRegularScreenWidth: `@media only screen (max-height: ${breakpoints.laptopXS}) and and (max-width: ${breakpoints.laptopXL}) `,
31
+ bigDesktop: `@media only screen and (min-width: ${breakpoints.desktopS}) and (min-height: ${breakpoints.laptopH})) `
32
+ };
@@ -0,0 +1,4 @@
1
+ export * from './ui';
2
+ export * from './theme';
3
+ export * from './pages';
4
+ export * from './base';