Skip to content

Commit

Permalink
remove portal
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Feb 5, 2024
1 parent 901e82d commit a0fe77a
Showing 1 changed file with 46 additions and 49 deletions.
95 changes: 46 additions & 49 deletions app/src/organisms/AnalyticsSettingsModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
} from '../../redux/analytics'
import { LegacyModal } from '../../molecules/LegacyModal'
import { StyledText } from '../../atoms/text'
import { Portal } from '../../App/portal'
import type { Dispatch } from '../../redux/types'

const PRIVACY_POLICY_LINK = 'https://opentrons.com/privacy-policy'
Expand All @@ -37,57 +36,55 @@ export function AnalyticsSettingsModal(): JSX.Element | null {
dispatch(toggleAnalyticsOptedIn())

Check warning on line 36 in app/src/organisms/AnalyticsSettingsModal/index.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/organisms/AnalyticsSettingsModal/index.tsx#L34-L36

Added lines #L34 - L36 were not covered by tests
}

return !seen ? (
<Portal>
<LegacyModal
title={
<StyledText css={TYPOGRAPHY.h3SemiBold}>
{t('acknowledge_privacy')}
</StyledText>
}
footer={
<Flex
justifyContent={JUSTIFY_FLEX_END}
paddingRight={SPACING.spacing16}
paddingBottom={SPACING.spacing16}
>
<PrimaryButton onClick={handleClick}>
<StyledText as="p">{t('agree')}</StyledText>
</PrimaryButton>
</Flex>
}
>
<Flex flexDirection={DIRECTION_COLUMN}>
return seen ? (
<LegacyModal
title={
<StyledText css={TYPOGRAPHY.h3SemiBold}>
{t('acknowledge_privacy')}
</StyledText>
}
footer={
<Flex
justifyContent={JUSTIFY_FLEX_END}
paddingRight={SPACING.spacing16}
paddingBottom={SPACING.spacing16}
>
<PrimaryButton onClick={handleClick}>
<StyledText as="p">{t('agree')}</StyledText>
</PrimaryButton>
</Flex>
}
>
<Flex flexDirection={DIRECTION_COLUMN}>
<Flex gridGap={SPACING.spacing10} flexDirection={DIRECTION_COLUMN}>
<Flex gridGap={SPACING.spacing10} flexDirection={DIRECTION_COLUMN}>
<Flex gridGap={SPACING.spacing10} flexDirection={DIRECTION_COLUMN}>
<Trans
t={t}
i18nKey={t('privacy_body')}
components={{ block: <StyledText as="p" /> }}
<Trans
t={t}
i18nKey={t('privacy_body')}
components={{ block: <StyledText as="p" /> }}
/>
</Flex>
<Link
external
fontSize={TYPOGRAPHY.fontSizeP}
css={TYPOGRAPHY.darkLinkLabelSemiBold}
href={PRIVACY_POLICY_LINK}
>
<Flex
flexDirection={DIRECTION_ROW}
alignItems={ALIGN_CENTER}
color={COLORS.blue50}
>
{t('opentrons_privacy_policy')}
<Icon
marginLeft={SPACING.spacing4}
name="external-link"
size="0.75rem"
/>
</Flex>
<Link
external
fontSize={TYPOGRAPHY.fontSizeP}
css={TYPOGRAPHY.darkLinkLabelSemiBold}
href={PRIVACY_POLICY_LINK}
>
<Flex
flexDirection={DIRECTION_ROW}
alignItems={ALIGN_CENTER}
color={COLORS.blue50}
>
{t('opentrons_privacy_policy')}
<Icon
marginLeft={SPACING.spacing4}
name="external-link"
size="0.75rem"
/>
</Flex>
</Link>
</Flex>
</Link>
</Flex>
</LegacyModal>
</Portal>
</Flex>
</LegacyModal>
) : null
}

0 comments on commit a0fe77a

Please sign in to comment.