-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae86c48
commit 5910909
Showing
1 changed file
with
44 additions
and
46 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 |
---|---|---|
@@ -1,65 +1,63 @@ | ||
import { useTranslation } from 'react-i18next' | ||
import styled from 'styled-components'; | ||
import styled from 'styled-components' | ||
|
||
import { | ||
Flex, | ||
StyledText, | ||
Link as LinkButton, | ||
POSITION_ABSOLUTE, | ||
TYPOGRAPHY, | ||
COLORS, | ||
POSITION_RELATIVE, | ||
ALIGN_CENTER, | ||
JUSTIFY_SPACE_BETWEEN, | ||
Flex, | ||
StyledText, | ||
Link as LinkButton, | ||
POSITION_ABSOLUTE, | ||
TYPOGRAPHY, | ||
COLORS, | ||
POSITION_RELATIVE, | ||
ALIGN_CENTER, | ||
JUSTIFY_SPACE_BETWEEN, | ||
} from '@opentrons/components' | ||
import { useAuth0 } from '@auth0/auth0-react' | ||
|
||
const HeaderBar = styled(Flex)` | ||
position: ${POSITION_RELATIVE}; | ||
background-color: ${COLORS.white}; | ||
width: 100%; | ||
align-items: ${ALIGN_CENTER}; | ||
height: 60px; | ||
`; | ||
position: ${POSITION_RELATIVE}; | ||
background-color: ${COLORS.white}; | ||
width: 100%; | ||
align-items: ${ALIGN_CENTER}; | ||
height: 60px; | ||
` | ||
|
||
const HeaderBarContent = styled(Flex)` | ||
position: ${POSITION_ABSOLUTE}; | ||
padding: 18px 32px; | ||
justify-content: ${JUSTIFY_SPACE_BETWEEN}; | ||
width: 100%; | ||
`; | ||
position: ${POSITION_ABSOLUTE}; | ||
padding: 18px 32px; | ||
justify-content: ${JUSTIFY_SPACE_BETWEEN}; | ||
width: 100%; | ||
` | ||
|
||
const HeaderGradientTitle = styled(StyledText)` | ||
background: linear-gradient(90deg, #562566 0%, #893BA4 47.5%, #C189D4 100%); | ||
background: linear-gradient(90deg, #562566 0%, #893ba4 47.5%, #c189d4 100%); | ||
-webkit-background-clip: text; | ||
-webkit-text-fill-color: transparent; | ||
font-size: 16px; | ||
`; | ||
font-size: 16px; | ||
` | ||
|
||
const HeaderTitle = styled(StyledText)` | ||
font-size: 16px; | ||
`; | ||
font-size: 16px; | ||
` | ||
|
||
const LogoutButton = styled(LinkButton)` | ||
color: ${COLORS.grey50}; | ||
font-size: ${TYPOGRAPHY.fontSizeH3}; | ||
`; | ||
color: ${COLORS.grey50}; | ||
font-size: ${TYPOGRAPHY.fontSizeH3}; | ||
` | ||
|
||
export function Header(): JSX.Element { | ||
const { t } = useTranslation('protocol_generator') | ||
const { logout } = useAuth0() | ||
|
||
return ( | ||
<HeaderBar> | ||
<HeaderBarContent> | ||
<Flex> | ||
<HeaderTitle>{'Opentrons'}</HeaderTitle> | ||
<HeaderGradientTitle>{'AI'}</HeaderGradientTitle> | ||
</Flex> | ||
<LogoutButton onClick={() => logout()}> | ||
{t('Log out')} | ||
</LogoutButton> | ||
</HeaderBarContent> | ||
</HeaderBar> | ||
) | ||
} | ||
const { t } = useTranslation('protocol_generator') | ||
const { logout } = useAuth0() | ||
|
||
return ( | ||
<HeaderBar> | ||
<HeaderBarContent> | ||
<Flex> | ||
<HeaderTitle>{'Opentrons'}</HeaderTitle> | ||
<HeaderGradientTitle>{'AI'}</HeaderGradientTitle> | ||
</Flex> | ||
<LogoutButton onClick={() => logout()}>{t('Log out')}</LogoutButton> | ||
</HeaderBarContent> | ||
</HeaderBar> | ||
) | ||
} |