-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created the footer component with the privacy policy and EULA
- Loading branch information
1 parent
d0cf67d
commit 7671fb8
Showing
4 changed files
with
112 additions
and
0 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
22 changes: 22 additions & 0 deletions
22
opentrons-ai-client/src/molecules/Footer/Footer.stories.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,22 @@ | ||
import { type Meta, type StoryObj } from '@storybook/react' | ||
import { Footer } from '.' | ||
import { COLORS, Flex } from '@opentrons/components' | ||
|
||
const meta: Meta<typeof Footer> = { | ||
title: 'AI/Molecules/Footer', | ||
component: Footer, | ||
decorators: [ | ||
Story => ( | ||
<Flex | ||
backgroundColor={COLORS.grey10}> | ||
<Story /> | ||
</Flex> | ||
), | ||
] | ||
} | ||
export default meta | ||
|
||
type Story = StoryObj<typeof Footer> | ||
|
||
export const FooterExample: Story = { | ||
} |
31 changes: 31 additions & 0 deletions
31
opentrons-ai-client/src/molecules/Footer/__tests__/Footer.test.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,31 @@ | ||
import { Footer } from '..'; | ||
import { renderWithProviders } from '../../../__testing-utils__' | ||
import { screen } from '@testing-library/react' | ||
|
||
const render = () => { | ||
return renderWithProviders(<Footer />) | ||
} | ||
|
||
describe('Footer', () => { | ||
it('should render Footer component', () => { | ||
render() | ||
screen.getByText('By continuing, you agree to the Opentrons') | ||
screen.getByText('Privacy Policy') | ||
screen.getByText('and') | ||
screen.getByText('End user license agreement') | ||
screen.getByText('Copyright © 2024 Opentrons') | ||
}); | ||
|
||
it('should have a link to the Privacy Policy', () => { | ||
render() | ||
const privacyPolicy = screen.getByText('Privacy Policy'); | ||
expect(privacyPolicy).toHaveAttribute('href', 'https://insights.opentrons.com/hubfs/Legal%20Documentation/Opentrons-Labworks-Privacy-Policy-5-4-23.docx-1.pdf'); | ||
}); | ||
|
||
it('should have a link to the end user license agreement', () => { | ||
render() | ||
const eula = screen.getByText('End user license agreement'); | ||
expect(eula).toHaveAttribute('href', 'https://insights.opentrons.com/hubfs/Legal%20Documentation/Opentrons%20EULA%2020240710.pdf'); | ||
}); | ||
|
||
}); |
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,58 @@ | ||
import styled, { css } from 'styled-components' | ||
import { | ||
ALIGN_CENTER, | ||
COLORS, | ||
DIRECTION_COLUMN, | ||
Check failure on line 5 in opentrons-ai-client/src/molecules/Footer/index.tsx GitHub Actions / js checks
|
||
Flex, | ||
JUSTIFY_CENTER, | ||
SPACING, | ||
StyledText, | ||
TYPOGRAPHY, | ||
} from '@opentrons/components' | ||
import { useTranslation } from 'react-i18next' | ||
|
||
const NewLineText = styled.span` | ||
display: block; | ||
`; | ||
|
||
const BlueLink = styled.a` | ||
color: ${COLORS.blue50}; | ||
text-decoration: none; | ||
&:hover { | ||
text-decoration: underline; | ||
} | ||
`; | ||
|
||
const DISCLAIMER_TEXT_STYLE = css` | ||
color: ${COLORS.grey60}; | ||
font-size: ${TYPOGRAPHY.fontSizeH4}; | ||
line-height: ${TYPOGRAPHY.lineHeight16}; | ||
text-align: ${TYPOGRAPHY.textAlignCenter}; | ||
padding-bottom: ${SPACING.spacing24}; | ||
`; | ||
|
||
export function Footer(): JSX.Element { | ||
const { t } = useTranslation('protocol_generator') | ||
const privacyPolicyText = t('privacy_policy'); | ||
const [firstPart, privacyPolicy, and, EULA, copyright] = privacyPolicyText.split('\n'); | ||
|
||
return ( | ||
<Flex | ||
width="100%" | ||
height="88px" | ||
backgroundColor={COLORS.grey10} | ||
alignItems={ALIGN_CENTER} | ||
justifyContent={JUSTIFY_CENTER} | ||
paddingTop={SPACING.spacing24} | ||
> | ||
<StyledText css={DISCLAIMER_TEXT_STYLE}> | ||
{firstPart} | ||
<BlueLink href="https://insights.opentrons.com/hubfs/Legal%20Documentation/Opentrons-Labworks-Privacy-Policy-5-4-23.docx-1.pdf" target="_blank" rel="noopener noreferrer">{privacyPolicy}</BlueLink> | ||
{and} | ||
<BlueLink href="https://insights.opentrons.com/hubfs/Legal%20Documentation/Opentrons%20EULA%2020240710.pdf" target="_blank" rel="noopener noreferrer">{EULA}</BlueLink> | ||
<NewLineText>{copyright}</NewLineText> | ||
</StyledText> | ||
</Flex> | ||
) | ||
} |