From 45daa2807b3bc848ce987d706ae816b6fe6bb460 Mon Sep 17 00:00:00 2001 From: Gordon Grund <80682839+ggrund-tsi@users.noreply.github.com> Date: Mon, 5 Jul 2021 07:52:03 +0200 Subject: [PATCH] add fade animation (#107) --- src/assets/SCSS/custom.scss | 16 +- src/components/landing-page.component.tsx | 17 +- .../modules/card-footer.component.tsx | 2 + .../record-recovery-cert-data.component.tsx | 251 +++++++++--------- .../record-test-cert-data.component.tsx | 219 +++++++-------- ...record-vaccination-cert-data.component.tsx | 221 +++++++-------- src/components/show-certificate.component.tsx | 154 +++++------ src/misc/useValueSet.tsx | 8 +- src/routing.component.tsx | 8 +- 9 files changed, 462 insertions(+), 434 deletions(-) diff --git a/src/assets/SCSS/custom.scss b/src/assets/SCSS/custom.scss index 9cfbb9d..6e2b2f9 100644 --- a/src/assets/SCSS/custom.scss +++ b/src/assets/SCSS/custom.scss @@ -1,5 +1,5 @@ //Font Definitions -@import '@fortawesome/fontawesome-free/css/solid.min.css'; +@import "@fortawesome/fontawesome-free/css/solid.min.css"; // Override default variables before the import $body-bg: #cfcfcf; @@ -22,8 +22,12 @@ $data-card-border-radius: 0px; $input-border-radius: 4px; $user-image-width: 39px; -select, option { - font-family: 'Font Awesome 5 Free', 'Arial'; +select, +option { + font-family: "Font Awesome 5 Free", "Arial"; +} +body { + overflow-y: scroll; } hr { @@ -60,6 +64,10 @@ hr { border-radius: $data-card-border-radius; border: none; } +#data-body { + padding: 1rem; + padding-bottom: 0px; +} .data-modal { background-color: white; border-radius: $data-card-border-radius; @@ -325,6 +333,8 @@ hr { margin-left: 16px; display: flex; align-self: center; + padding-top: 2px; + height: 32px; } .bg-gray-1 { diff --git a/src/components/landing-page.component.tsx b/src/components/landing-page.component.tsx index b05d9af..aba99fa 100644 --- a/src/components/landing-page.component.tsx +++ b/src/components/landing-page.component.tsx @@ -19,7 +19,7 @@ * under the License. */ -import { Button, Container } from 'react-bootstrap' +import { Button, Container, Fade } from 'react-bootstrap' import '../i18n'; import { useTranslation } from 'react-i18next'; @@ -41,15 +41,16 @@ const LandingPage = () => { }, [context.navigation]) return (!isInit ? : - + + + {t('translation:welcome')} - {t('translation:welcome')} + + + - - - - - + + ) } diff --git a/src/components/modules/card-footer.component.tsx b/src/components/modules/card-footer.component.tsx index b053aa3..845863c 100644 --- a/src/components/modules/card-footer.component.tsx +++ b/src/components/modules/card-footer.component.tsx @@ -10,6 +10,8 @@ const CardFooter = (props: any) => { return (!props ? <> : + +
- - - - - - - - - -
- + + + {/* content area with patient inputs and check box */} + + + + {t('translation:your-certificate')} + + + + + + + + + + + + + {qrCodeValue ? <> + {/* {qrCodeValue} */} + : <>} + + + {qrCodeValue ? <> + : <>} + + TAN: {tan} + + + + + {/* footer with correction and finish button */} + + + + + + + + + + + + + + + + ) diff --git a/src/misc/useValueSet.tsx b/src/misc/useValueSet.tsx index d610436..b498c0f 100644 --- a/src/misc/useValueSet.tsx +++ b/src/misc/useValueSet.tsx @@ -84,6 +84,7 @@ export const useGetValueSets = (onInit?: (isInit: boolean) => void, onError?: (m const [valueSetHashList, setValueSetHashList] = React.useState(); const [valueSetList] = React.useState({}); + const [result, setResult] = React.useState(); const [isInit, setIsInit] = React.useState(false); // on mount load hash list @@ -122,6 +123,10 @@ export const useGetValueSets = (onInit?: (isInit: boolean) => void, onError?: (m if (onInit) { onInit(isInit); } + if (isInit) { + setResult(valueSetList); + } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [isInit, onInit]) const setValueSet = (hashListItem: IValueSetHashListItem) => { @@ -145,11 +150,10 @@ export const useGetValueSets = (onInit?: (isInit: boolean) => void, onError?: (m } else { console.log('no valid valueset hash'); - } } - return valueSetList; + return result; } // ValueSetList diff --git a/src/routing.component.tsx b/src/routing.component.tsx index d9d31b6..84f3f8d 100644 --- a/src/routing.component.tsx +++ b/src/routing.component.tsx @@ -56,6 +56,7 @@ const Routing = () => { const [errorShow, setErrorShow] = React.useState(false); const [dataPrivacyShow, setDataPrivacyShow] = React.useState(false); const [imprintShow, setImprintShow] = React.useState(false); + const [isInit, setIsInit] = React.useState(false); const context: IAppContext = { navigation: useNavigation(), @@ -77,7 +78,12 @@ const Routing = () => { } }, [errorShow]) - return (!(context.valueSets && context.navigation) ? : + React.useEffect(() => { + if (context.valueSets && Object.entries(context.valueSets).length > 0 && context.navigation) + setIsInit(true); + }, [context.navigation, context.valueSets]) + + return (!(isInit && context.valueSets && context.navigation) ? : <> {/*