-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(opentrons-ai-client): Created the footer component with the privacy policy and EULA #16535
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7671fb8
created the footer component with the privacy policy and EULA
connected-znaim 4a5390d
fix footer tests
connected-znaim 97d5f85
converted the css to use styled instead
connected-znaim 97357c9
fixed lint issue
connected-znaim cc2075f
ran prettier
connected-znaim c4bc9ab
used trans to break up the text and its links
connected-znaim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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> | ||
) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can use the styled component approach to keep consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed