diff --git a/public/images/logo_blue.png b/public/images/logo_blue.png new file mode 100644 index 00000000..731cfe0d Binary files /dev/null and b/public/images/logo_blue.png differ diff --git a/src/components/pwa/Pwa.tsx b/src/components/pwa/Pwa.tsx index 92f4b688..af0ee636 100644 --- a/src/components/pwa/Pwa.tsx +++ b/src/components/pwa/Pwa.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Button, Grid, Container, LinearProgress, Divider } from '@mui/material'; +import { Button, Grid, Container, LinearProgress, Divider, Collapse, Box } from '@mui/material'; import PwaApps from './PwaApps'; import PwaAppBar from './PwaAppBar'; import { useScrollElement } from '../layout/ScrollElementProvider'; @@ -7,6 +7,7 @@ import useHeight from '../layout/ViewPort/hooks/useHeight'; import { useHandleTableReset, useTableFilterUpdate, useTableFilterValue } from '../application/GenericTable/store'; import { isEmpty } from '../../helpers'; import { Conditions } from '../../database/models/Application'; +import logo from '../../images/logo_blue.png'; const SingleAnswerButtons = ({ value, onChange, onNext, options = [] }) => { const handleClick = React.useCallback( @@ -130,9 +131,11 @@ const getQuestionFilters = values => { const defaultState = { index: 0, backIndex: 0, values: {} }; export default function Pwa() { - const [{ index, values }, setState] = React.useState(defaultState); + const [{ index, values }, setState] = React.useState({ ...defaultState, index: -1 }); + const showWelcome = index < 0 ? true : false; - const question = index <= questions.length - 1 ? questions[index] : { id: undefined, label: '', options: [], Field: () => <>, onSelect: undefined }; + const question = + index >= 0 && index <= questions.length - 1 ? questions[index] : { id: undefined, label: '', options: [], Field: () => <>, onSelect: undefined }; const searchIndex = questions.length; const { id, label, options, Field = SingleAnswerButtons, onSelect = undefined } = question; @@ -183,7 +186,7 @@ export default function Pwa() { }, [setState, scrollTop]); const handleBack = React.useCallback(() => { - setState(p => ({ ...p, index: p?.backIndex, backIndex: p.backIndex > 0 ? p.backIndex - 1 : 0 })); + setState(p => ({ ...p, index: p?.backIndex, backIndex: p.backIndex >= 0 ? p.backIndex - 1 : -1 })); scrollTop(); }, [setState, scrollTop]); @@ -205,46 +208,71 @@ export default function Pwa() { return ( - - - - - - - - - {showResults ? ( - - ) : ( - - - - - + {showWelcome ? ( + + + + + Welcome to MINDapps! - - {index + 1} / {questions.length} + + mindapp + + + Take this quiz to find a suitable app. + + + + + + ) : ( + <> + + + + + + + - - - - - {label} - - - - - + {showResults ? ( + + ) : ( + + + + + + + + {index + 1} / {questions.length} + + + + + + + + {label} + + + + + + )} + )} ); diff --git a/src/images/logo_blue.png b/src/images/logo_blue.png new file mode 100644 index 00000000..731cfe0d Binary files /dev/null and b/src/images/logo_blue.png differ