Skip to content

Commit

Permalink
chore: best effort on allow diagnostics modal
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed Feb 15, 2024
1 parent c6d2507 commit 6523b22
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { Box, Flex, Stack, styled } from 'leather-styles/jsx';
import { Button } from '@app/ui/components/button/button';
import { Dialog } from '@app/ui/components/containers/dialog/dialog';
import { Footer } from '@app/ui/components/containers/footers/footer';
import { Header } from '@app/ui/components/containers/headers/header';

Check failure on line 7 in src/app/pages/onboarding/allow-diagnostics/allow-diagnostics-layout.tsx

View workflow job for this annotation

GitHub Actions / typecheck

'Header' is declared but its value is never read.
import { CheckmarkIcon } from '@app/ui/components/icons/checkmark-icon';
import { LeatherIcon } from '@app/ui/components/icons/leather-icon';

interface ReasonToAllowDiagnosticsProps {
text: string;
Expand All @@ -29,8 +31,35 @@ export function AllowDiagnosticsLayout({
onUserDenyDiagnostics,
}: AllowDiagnosticsLayoutProps) {
return (
<Dialog isShowing>
<Stack gap="space.04" p="space.05" minWidth={{ base: '100%', md: '452px' }}>
<Dialog
isShowing
footer={
<Footer>
<Flex flexDirection="row" gap="space.04">
<Button
flexGrow={1}
variant="outline"
onClick={() => onUserDenyDiagnostics()}
data-testid={OnboardingSelectors.DenyAnalyticsBtn}
>
Deny
</Button>
<Button
flexGrow={1}
autoFocus
data-testid={OnboardingSelectors.AllowAnalyticsBtn}
onClick={onUserAllowDiagnostics}
>
Allow
</Button>
</Flex>
</Footer>
}
>
<Stack py="space.04" gap="space.04">
<Box height="32px">
<LeatherIcon />
</Box>
<styled.h1 textStyle="heading.03">Help us improve</styled.h1>
<styled.p textStyle="heading.05">
Leather would like to gather deidentified service usage data to help improve the
Expand All @@ -43,26 +72,6 @@ export function AllowDiagnosticsLayout({
<ReasonToAllowDiagnostics text="This data is used to generate and send crash reports, help fix errors, and analyze statistics" />
</Stack>
</Stack>
<Footer>
<Flex flexDirection="row" gap="space.04">
<Button
flexGrow={1}
variant="outline"
onClick={() => onUserDenyDiagnostics()}
data-testid={OnboardingSelectors.DenyAnalyticsBtn}
>
Deny
</Button>
<Button
flexGrow={1}
autoFocus
data-testid={OnboardingSelectors.AllowAnalyticsBtn}
onClick={onUserAllowDiagnostics}
>
Allow
</Button>
</Flex>
</Footer>
</Dialog>
);
}
14 changes: 0 additions & 14 deletions src/app/ui/components/containers/dialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export function BigTitle({ title }: { title: string }) {

export interface DialogProps {
children?: ReactNode;
header?: ReactNode;
footer?: ReactNode;
isShowing: boolean;
isWaitingOnPerformedAction?: boolean;
Expand Down Expand Up @@ -75,33 +74,20 @@ export const Dialog = memo(
animation: 'contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1)',
})}
>
{/* PETE check this for onboarding as the header spacing should be space.04 and not space.05 */}
{/* {header ? (
header
) : ( */}

{title && (
<Header
variant="page"
isWaitingOnPerformedAction={isWaitingOnPerformedAction}
onClose={onClose}
// onGoBack={onGoBack}
title={isString(title) ? <Title title={title} /> : title}
/>
)}

{/* TODO - test this cross browser and remove if repaced by global.ts
Probably is needed for account selector
*/}
<Box
className={css({
// height: '520px',
// maxHeight: 'fit-content',
height: 'dialogContentHeight',
maxHeight: 'dialogContentHeight',
paddingX: 'space.05',
// overflowY: 'scroll',
overflowY: 'auto',
'&::-webkit-scrollbar': {
display: 'none',
Expand Down
4 changes: 1 addition & 3 deletions src/app/ui/components/containers/headers/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ReactNode } from 'react';

import { Flex, HStack, styled } from 'leather-styles/jsx';

import { AppVersion } from '@app/components/app-version';
import { ArrowLeftIcon } from '@app/ui/components/icons/arrow-left-icon';
import { CloseIcon } from '@app/ui/components/icons/close-icon';

Expand All @@ -27,7 +26,7 @@ export interface HeaderProps {
}

export function Header({
variant = 'page',
variant,
// enableGoBack,
isWaitingOnPerformedAction,
onClose,
Expand Down Expand Up @@ -61,7 +60,6 @@ export function Header({
/>
) : undefined}
{account ? account : logo}
<AppVersion />
</Flex>
)}
{title}
Expand Down

0 comments on commit 6523b22

Please sign in to comment.