-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathLogo.tsx
More file actions
73 lines (59 loc) · 1.67 KB
/
Logo.tsx
File metadata and controls
73 lines (59 loc) · 1.67 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import React, { useMemo } from "react";
import styled, { Theme } from "styled-components";
import { hoverShortTransitionTiming } from "styles/commonStyles";
import { Link } from "react-router-dom";
import { ArbitratorTypes, getArbitratorType } from "consts/index";
import { isUndefined } from "utils/index";
import KlerosCourtLogo from "svgs/header/kleros-court.svg";
const Container = styled.div`
display: flex;
flex-direction: row;
align-items: center;
gap: 16px;
`;
const BadgeContainer = styled.div<{ backgroundColor: keyof Theme }>`
transform: skewX(-15deg);
background-color: ${({ theme, backgroundColor }) => theme[backgroundColor]};
border-radius: 3px;
padding: 1px 8px;
height: fit-content;
`;
const BadgeText = styled.label`
color: ${({ theme }) => theme.darkPurple};
`;
const StyledKlerosCourtLogo = styled(KlerosCourtLogo)`
${hoverShortTransitionTiming}
max-height: 40px;
width: auto;
&:hover {
path {
fill: ${({ theme }) => theme.white}BF;
}
}
`;
const CourtBadge: React.FC = () => {
const { text, color } = useMemo<{ text?: string; color?: keyof Theme }>(() => {
switch (getArbitratorType()) {
case ArbitratorTypes.neo:
return { text: "Beta", color: "paleCyan" };
case ArbitratorTypes.university:
return { text: "Uni", color: "limeGreen" };
}
return {};
}, []);
return !isUndefined(color) ? (
<BadgeContainer {...{ backgroundColor: color }}>
<BadgeText>{text}</BadgeText>
</BadgeContainer>
) : null;
};
const Logo: React.FC = () => (
<Container>
{" "}
<Link to={"/"}>
<StyledKlerosCourtLogo />
</Link>
<CourtBadge />
</Container>
);
export default Logo;