-
Notifications
You must be signed in to change notification settings - Fork 46
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
Showing
2 changed files
with
58 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import XIcon from "svgs/socialmedia/x.svg"; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: space-between; | ||
`; | ||
|
||
const StyledTitle = styled.h1` | ||
margin-bottom: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); | ||
`; | ||
|
||
const XLinkContainer = styled.div` | ||
display: flex; | ||
color: ${({ theme }) => theme.primaryBlue}; | ||
margin-bottom: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); | ||
`; | ||
|
||
const StyledXIcon = styled(XIcon)` | ||
fill: ${({ theme }) => theme.primaryBlue}; | ||
width: 16px; | ||
height: 16px; | ||
`; | ||
|
||
const StyledLink = styled.a` | ||
display: flex; | ||
border: 0px; | ||
align-items: center; | ||
gap: 8px; | ||
&:hover { | ||
text-decoration: underline; | ||
} | ||
`; | ||
|
||
const Header: React.FC = () => { | ||
const courtUrl = window.location.origin; | ||
const xPostText = `Hey I've been busy as a Juror on the Kleros court, check out my score: Level: 2 (Diogenes). Coherence score: 8. Be a juror with me -> ${courtUrl}`; | ||
const xShareUrl = `https://twitter.com/intent/tweet?text=${encodeURIComponent(xPostText)}`; | ||
|
||
return ( | ||
<Container> | ||
<StyledTitle>Juror Dashboard</StyledTitle> | ||
<XLinkContainer> | ||
<StyledLink href={xShareUrl} target="_blank" rel="noreferrer"> | ||
<StyledXIcon /> <span>Share your juror score</span> | ||
</StyledLink> | ||
</XLinkContainer> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default Header; |
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