-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Data and Privacy Screen and Privacy Policy Screen. Onboarding Top Menu also.
- Loading branch information
Showing
25 changed files
with
1,272 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
/data | ||
/messages | ||
/translations | ||
src/renderer/src/routeTree.gen.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import { styled } from '@mui/material/styles' | ||
import { useNavigate, useRouter } from '@tanstack/react-router' | ||
import { defineMessages, useIntl } from 'react-intl' | ||
|
||
import { BLACK, BLUE_GREY, COMAPEO_BLUE, WHITE } from '../colors' | ||
import { Button } from './Button' | ||
import { Text } from './Text' | ||
|
||
const MenuContainer = styled('div')({ | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
alignItems: 'center', | ||
width: '55%', | ||
margin: '16px auto', | ||
position: 'relative', | ||
}) | ||
const GoBackButton = styled(Button)({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
gap: 8, | ||
backgroundColor: 'transparent', | ||
color: BLUE_GREY, | ||
fontSize: 16, | ||
padding: '12px 32px', | ||
borderRadius: 20, | ||
whiteSpace: 'nowrap', | ||
'&:hover': { | ||
backgroundColor: 'rgba(0, 0, 0, 0.1)', | ||
}, | ||
}) | ||
const BackArrow = styled('span')({ | ||
fontSize: 24, | ||
color: WHITE, | ||
}) | ||
const StepsContainer = styled('div')({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
}) | ||
const Steps = styled('div')({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
gap: 16, | ||
}) | ||
const Step = styled('div')(({ active }: { active: boolean }) => ({ | ||
backgroundColor: active ? WHITE : 'transparent', | ||
color: active ? BLACK : BLUE_GREY, | ||
padding: '12px 32px', | ||
borderRadius: 20, | ||
fontWeight: active ? 'bold' : 'normal', | ||
whiteSpace: 'nowrap', | ||
})) | ||
const Divider = styled('div')({ | ||
width: 16, | ||
height: 1, | ||
backgroundColor: COMAPEO_BLUE, | ||
alignSelf: 'center', | ||
margin: '0 12px', | ||
}) | ||
|
||
interface OnboardingTopMenuProps { | ||
currentStep: number | ||
} | ||
|
||
const m = defineMessages({ | ||
goBack: { | ||
id: 'components.OnboardingTopMenu.goBack', | ||
defaultMessage: 'Go back', | ||
}, | ||
step: { | ||
id: 'components.OnboardingTopMenu.step', | ||
defaultMessage: 'Step {number}', | ||
}, | ||
}) | ||
|
||
export function OnboardingTopMenu({ currentStep }: OnboardingTopMenuProps) { | ||
const navigate = useNavigate() | ||
const router = useRouter() | ||
const { formatMessage } = useIntl() | ||
const stepToRoute: Record<number, string> = { | ||
1: 'DataPrivacy', | ||
2: 'NextStep', | ||
3: 'PrivacyPolicyScreen', | ||
} | ||
|
||
return ( | ||
<MenuContainer> | ||
<GoBackButton | ||
onClick={() => router.history.back()} | ||
variant="text" | ||
style={{ | ||
color: BLUE_GREY, | ||
gap: 8, | ||
padding: '12px 32px', | ||
}} | ||
aria-label={formatMessage(m.goBack)} | ||
> | ||
<BackArrow aria-hidden="true">←</BackArrow> | ||
{formatMessage(m.goBack)} | ||
</GoBackButton> | ||
<Steps> | ||
{[1, 2, 3].map((step) => ( | ||
<StepsContainer key={step}> | ||
<Step | ||
active={currentStep === step} | ||
onClick={() => | ||
navigate({ to: `/Onboarding/${stepToRoute[step]}` }) | ||
} | ||
> | ||
<Text kind="body" bold={currentStep === step}> | ||
{formatMessage(m.step, { number: step })} | ||
</Text> | ||
</Step> | ||
{step < 3 && <Divider />} | ||
</StepsContainer> | ||
))} | ||
</Steps> | ||
</MenuContainer> | ||
) | ||
} |
42 changes: 42 additions & 0 deletions
42
src/renderer/src/components/PrivacyPolicy/DiagnosticItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import CircleIcon from '@mui/icons-material/Circle' | ||
import { styled } from '@mui/material/styles' | ||
|
||
import { DARK_GREY } from '../../colors' | ||
import { Text } from '../../components/Text' | ||
|
||
const DiagnosticsItem = styled('div')({ | ||
display: 'flex', | ||
flexDirection: 'row', | ||
alignItems: 'flex-start', | ||
gap: 8, | ||
marginBottom: 12, | ||
paddingLeft: 12, | ||
}) | ||
const DiagnosticsTitle = styled(Text)({ | ||
fontWeight: 'bold', | ||
marginRight: 4, | ||
color: DARK_GREY, | ||
lineHeight: 1, | ||
}) | ||
const DiagnosticsDescription = styled(Text)({ | ||
display: 'inline', | ||
}) | ||
|
||
export const DiagnosticItem = ({ | ||
title, | ||
description, | ||
}: { | ||
title: string | ||
description: string | ||
}) => ( | ||
<DiagnosticsItem> | ||
<CircleIcon | ||
fontSize="small" | ||
sx={{ fontSize: 6, color: DARK_GREY, marginTop: 1 }} | ||
/> | ||
<DiagnosticsTitle kind="subtitle"> | ||
{title}:{' '} | ||
<DiagnosticsDescription kind="body">{description}</DiagnosticsDescription> | ||
</DiagnosticsTitle> | ||
</DiagnosticsItem> | ||
) |
Oops, something went wrong.