-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web): add onboarding mini guides, link it to help component, abs…
…tract better, style better
- Loading branch information
Showing
10 changed files
with
372 additions
and
47 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
web/src/assets/svgs/mini-guides/onboarding/how-it-works.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions
81
web/src/assets/svgs/mini-guides/onboarding/what-do-i-need.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
8 changes: 8 additions & 0 deletions
8
web/src/components/Popup/MiniGuides/Onboarding/HowItWorks.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,8 @@ | ||
import React from "react"; | ||
import HowItWorksImage from "tsx:assets/svgs/mini-guides/onboarding/how-it-works.svg"; | ||
|
||
const HowItWorks: React.FC = () => { | ||
return <HowItWorksImage />; | ||
}; | ||
|
||
export default HowItWorks; |
38 changes: 38 additions & 0 deletions
38
web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.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,38 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import PnkIcon from "tsx:assets/svgs/styled/pnk.svg"; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
gap: 32px; | ||
align-items: center; | ||
`; | ||
|
||
const StyledPnkIcon = styled(PnkIcon)` | ||
width: calc(220px + (280 - 220) * (min(max(100vw, 375px), 1250px) - 375px) / 875); | ||
height: calc(220px + (252 - 220) * (min(max(100vw, 375px), 1250px) - 375px) / 875); | ||
`; | ||
|
||
const StyledCourtLabel = styled.label` | ||
font-size: 24px; | ||
background: linear-gradient( | ||
90deg, | ||
${({ theme }) => theme.secondaryPurple} 0%, | ||
${({ theme }) => theme.primaryBlue} 100% | ||
); | ||
background-clip: text; | ||
-webkit-background-clip: text; | ||
-webkit-text-fill-color: transparent; | ||
`; | ||
|
||
const PnkLogoAndTitle: React.FC = () => { | ||
return ( | ||
<Container> | ||
<StyledPnkIcon /> | ||
<StyledCourtLabel>Court v.2</StyledCourtLabel> | ||
</Container> | ||
); | ||
}; | ||
export default PnkLogoAndTitle; |
8 changes: 8 additions & 0 deletions
8
web/src/components/Popup/MiniGuides/Onboarding/WhatDoINeed.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,8 @@ | ||
import React from "react"; | ||
import WhatDoINeedImage from "tsx:assets/svgs/mini-guides/onboarding/what-do-i-need.svg"; | ||
|
||
const WhatDoINeed: React.FC = () => { | ||
return <WhatDoINeedImage />; | ||
}; | ||
|
||
export default WhatDoINeed; |
108 changes: 108 additions & 0 deletions
108
web/src/components/Popup/MiniGuides/Onboarding/index.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,108 @@ | ||
import React, { useState } from "react"; | ||
import styled from "styled-components"; | ||
import Template from "../Template"; | ||
import HowItWorks from "./HowItWorks"; | ||
import PnkLogoAndTitle from "./PnkLogoAndTitle"; | ||
import WhatDoINeed from "./WhatDoINeed"; | ||
|
||
const Title = styled.h1` | ||
margin-bottom: 18px; | ||
`; | ||
|
||
const StyledLabel = styled.label` | ||
color: ${({ theme }) => theme.primaryBlue}; | ||
margin: 0; | ||
cursor: pointer; | ||
`; | ||
|
||
const ParagraphsContainer = styled.div` | ||
display: flex; | ||
gap: 18px; | ||
flex-direction: column; | ||
`; | ||
|
||
const LinksContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
const LeftContentContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
const leftPageContents = [ | ||
{ | ||
title: "Welcome to Kleros Court", | ||
paragraphs: ["The decentralized arbitration service for the disputes of the new economy.", "Learn what’s new"], | ||
links: [], | ||
}, | ||
{ | ||
title: "What do I need to start?", | ||
paragraphs: [ | ||
"Do you want to be a juror? If yes, you will need PNK tokens for staking on courts, and ETH for gas fees.", | ||
"I don't want to be a juror. Can I still participate in the Court? Yes, sure. Users can also participate as" + | ||
" contributors by helping fund appeal fees in exchange for rewards, or by submitting evidence." + | ||
" In this case, you will need ETH.", | ||
"I have a case that needs resolution? What do I do? It's simple. Send your case to Kleros and receive" + | ||
" the resolution. You will need a few minutes to fill up the details of your case, and ETH to pay for" + | ||
" Arbitration fees (It's used to pay jurors for their work).", | ||
], | ||
links: [], | ||
}, | ||
{ | ||
title: "Access the Mini Guides", | ||
paragraphs: [], | ||
links: ["1. Staking", "2. Binary Voting", "3. Ranked Voting", "4. Appeal", "5. Juror Levels"], | ||
}, | ||
]; | ||
|
||
const rightPageComponents = [() => <PnkLogoAndTitle />, () => <WhatDoINeed />, () => <HowItWorks />]; | ||
|
||
const LeftContent: React.FC<{ currentPage: number }> = ({ currentPage }) => { | ||
const { title, paragraphs, links } = leftPageContents[currentPage - 1]; | ||
|
||
return ( | ||
<LeftContentContainer> | ||
<Title>{title}</Title> | ||
<ParagraphsContainer> | ||
{paragraphs.map((paragraph, index) => ( | ||
<label key={index}>{paragraph}</label> | ||
))} | ||
</ParagraphsContainer> | ||
<LinksContainer> | ||
{links.map((link, index) => ( | ||
<StyledLabel key={index}>{link}</StyledLabel> | ||
))} | ||
</LinksContainer> | ||
</LeftContentContainer> | ||
); | ||
}; | ||
|
||
const RightContent: React.FC<{ currentPage: number }> = ({ currentPage }) => { | ||
const RightPageComponent = rightPageComponents[currentPage - 1]; | ||
|
||
return <RightPageComponent />; | ||
}; | ||
|
||
interface IOnboarding { | ||
toggleIsOnboardingMiniGuidesOpen: () => void; | ||
} | ||
|
||
const Onboarding: React.FC<IOnboarding> = ({ toggleIsOnboardingMiniGuidesOpen }) => { | ||
const [currentPage, setCurrentPage] = useState(1); | ||
|
||
return ( | ||
<Template | ||
LeftContent={<LeftContent currentPage={currentPage} />} | ||
RightContent={<RightContent currentPage={currentPage} />} | ||
onClose={toggleIsOnboardingMiniGuidesOpen} | ||
currentPage={currentPage} | ||
setCurrentPage={setCurrentPage} | ||
numPages={leftPageContents.length} | ||
isOnboarding={true} | ||
/> | ||
); | ||
}; | ||
|
||
export default Onboarding; |
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
Oops, something went wrong.