-
Notifications
You must be signed in to change notification settings - Fork 294
/
OnboardingNavHeader.tsx
46 lines (41 loc) · 1.21 KB
/
OnboardingNavHeader.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import React from "react";
import styled from "styled-components";
import { Box, Button, Header, Icons } from "@ledgerhq/react-ui";
import LangSwitcher from "./LangSwitcher";
import ledgerLogo from "./assets/ledgerLogo.svg";
import { registerAssets } from "~/renderer/components/Onboarding/preloadAssets";
import { useTranslation } from "react-i18next";
registerAssets([ledgerLogo]);
const OnboardingContainer = styled(Header)`
position: absolute;
top: 40px;
left: 16px;
right: 30px;
z-index: 1;
align-items: center;
`;
const Logo = styled(Box).attrs({
backgroundColor: "neutral.c100",
height: "25px",
width: "75px",
})`
-webkit-mask-image: url('${ledgerLogo}');
mask-image: url('${ledgerLogo}');
`;
interface Props {
onClickPrevious: (event?: React.SyntheticEvent<HTMLButtonElement, Event>) => void;
}
export default function OnboardingNavHeader({ onClickPrevious }: Props) {
const { t } = useTranslation();
const left = (
<Button iconPosition="left" Icon={Icons.ArrowLeftRegular} onClick={onClickPrevious}>
{t("common.previous")}
</Button>
);
const right = <LangSwitcher />;
return (
<OnboardingContainer {...{ left, right }}>
<Logo />
</OnboardingContainer>
);
}