- Notifications
You must be signed in to change notification settings - Fork 50
feat(web): mobile view top jurors and some refactors #1303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jaybuidl merged 6 commits into dev from feat(web)/mobile-view-top-jurors-and-some-refactors Oct 30, 2023
Merged
Changes from 2 commits
Commits
Show all changes
6 commits Select commit Hold shift + click to select a range
8e45aa7 refactor(web): top jurors components modularization
kemuru 38f61bc feat(web): mobile version top jurors + bunch of code refactors
kemuru 62e6a91 Merge branch 'dev' into feat(web)/mobile-view-top-jurors-and-some-ref…
jaybuidl e5ded92 fix(web): resolve changes requested
kemuru f2803cb Merge branch 'dev' into feat(web)/mobile-view-top-jurors-and-some-ref…
jaybuidl d4f554b Merge branch 'feat(web)/mobile-view-top-jurors-and-some-refactors' of…
jaybuidl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 hidden or 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
This file contains hidden or 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,46 @@ | ||
| import React from "react"; | ||
| import styled, { css } from "styled-components"; | ||
| import { BREAKPOINT_LANDSCAPE, landscapeStyle } from "styles/landscapeStyle"; | ||
| import { useWindowSize } from "react-use"; | ||
| import WithHelpTooltip from "pages/Dashboard/WithHelpTooltip"; | ||
| | ||
| const Container = styled.div` | ||
| label { | ||
| font-size: 12px !important; | ||
| &::before { | ||
| content: "Votes"; | ||
| } | ||
| } | ||
| | ||
| ${landscapeStyle( | ||
| () => | ||
| css` | ||
| display: flex; | ||
| | ||
| label { | ||
| font-size: 14px !important; | ||
| &::before { | ||
| content: "Coherent Votes"; | ||
| } | ||
| } | ||
| ` | ||
| )} | ||
| `; | ||
| | ||
| const coherentVotesTooltipMsg = | ||
| "This is the ratio of coherent votes made by a juror: " + | ||
| "the number in the left is the number of times where the juror " + | ||
| "voted coherently and the number in the right is the total number of times " + | ||
| "the juror voted"; | ||
| | ||
| const Coherency: React.FC = () => { | ||
| const { width } = useWindowSize(); | ||
| return ( | ||
| <Container> | ||
| <WithHelpTooltip place={width > BREAKPOINT_LANDSCAPE ? "top" : "left"} tooltipMsg={coherentVotesTooltipMsg}> | ||
| <label></label> | ||
| </WithHelpTooltip> | ||
| </Container> | ||
| ); | ||
| }; | ||
| export default Coherency; | ||
This file contains hidden or 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,27 @@ | ||
| import React from "react"; | ||
| import styled from "styled-components"; | ||
| import BookOpenIcon from "tsx:assets/svgs/icons/book-open.svg"; | ||
| | ||
| const Container = styled.div` | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 8px; | ||
| | ||
| label { | ||
| color: ${({ theme }) => theme.primaryBlue}; | ||
| } | ||
| | ||
| svg { | ||
| path { | ||
| fill: ${({ theme }) => theme.primaryBlue}; | ||
| } | ||
| } | ||
| `; | ||
| | ||
| const Rewards: React.FC = () => ( | ||
| <Container> | ||
| <BookOpenIcon /> | ||
| <label> How it works </label> | ||
| </Container> | ||
| ); | ||
| export default Rewards; |
This file contains hidden or 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,23 @@ | ||
| import React from "react"; | ||
| import styled from "styled-components"; | ||
| | ||
| const Container = styled.div` | ||
| display: flex; | ||
| align-items: center; | ||
| width: calc(40px + (220 - 40) * (min(max(100vw, 375px), 1250px) - 375px) / 875); | ||
| gap: 36px; | ||
| | ||
| label { | ||
kemuru marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| font-weight: 400; | ||
| font-size: 14px; | ||
| line-height: 19px; | ||
| color: ${({ theme }) => theme.secondaryText} !important; | ||
| } | ||
| `; | ||
| | ||
| const JurorTitle: React.FC = () => ( | ||
| <Container> | ||
| <label>Juror</label> | ||
| </Container> | ||
| ); | ||
| export default JurorTitle; | ||
This file contains hidden or 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,19 @@ | ||
| import React from "react"; | ||
| import styled from "styled-components"; | ||
| | ||
| const Container = styled.div` | ||
| width: calc(16px + (24 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); | ||
| | ||
| label { | ||
kemuru marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| &::before { | ||
| content: "#"; | ||
| } | ||
| } | ||
| `; | ||
| | ||
| const Rank: React.FC = () => ( | ||
| <Container> | ||
| <label></label> | ||
| </Container> | ||
| ); | ||
| export default Rank; | ||
This file contains hidden or 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,43 @@ | ||
| import React from "react"; | ||
| import styled, { css } from "styled-components"; | ||
| import { landscapeStyle } from "styles/landscapeStyle"; | ||
| import WithHelpTooltip from "pages/Dashboard/WithHelpTooltip"; | ||
| | ||
| const Container = styled.div` | ||
| label { | ||
| font-size: 12px !important; | ||
| &::before { | ||
| content: "Rewards"; | ||
| } | ||
| } | ||
| | ||
| ${landscapeStyle( | ||
| () => | ||
| css` | ||
| display: flex; | ||
| width: calc(60px + (240 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875); | ||
| | ||
| label { | ||
| font-size: 14px !important; | ||
| &::before { | ||
kemuru marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| content: "Total Rewards"; | ||
| } | ||
| } | ||
| ` | ||
| )} | ||
| `; | ||
| | ||
| const totalRewardsTooltipMsg = | ||
| "Users have an economic interest in serving as jurors in Kleros: " + | ||
| "collecting the Juror Rewards in exchange for their work. Each juror who " + | ||
| "is coherent with the final ruling receive the Juror Rewards composed of " + | ||
| "arbitration fees (ETH) + PNK redistribution between jurors."; | ||
| | ||
| const Rewards: React.FC = () => ( | ||
| <Container> | ||
| <WithHelpTooltip place="top" tooltipMsg={totalRewardsTooltipMsg}> | ||
| <label></label> | ||
| </WithHelpTooltip> | ||
| </Container> | ||
| ); | ||
| export default Rewards; | ||
This file contains hidden or 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,68 @@ | ||
| import React from "react"; | ||
| import styled, { css } from "styled-components"; | ||
| import { landscapeStyle } from "styles/landscapeStyle"; | ||
| import Rank from "./Rank"; | ||
| import JurorTitle from "./JurorTitle"; | ||
| import Rewards from "./Rewards"; | ||
| import Coherency from "./Coherency"; | ||
| import HowItWorks from "./HowItWorks"; | ||
| | ||
| const Container = styled.div` | ||
| display: flex; | ||
| justify-content: space-between; | ||
| width: 100%; | ||
| background-color: ${({ theme }) => theme.lightBlue}; | ||
| padding: 24px; | ||
| border 1px solid ${({ theme }) => theme.stroke}; | ||
| border-top-left-radius: 3px; | ||
| border-top-right-radius: 3px; | ||
| border-bottom: none; | ||
| flex-wrap: wrap; | ||
| | ||
| ${landscapeStyle( | ||
| () => | ||
| css` | ||
| border-bottom: 1px solid ${({ theme }) => theme.stroke}; | ||
| padding: 18.6px 32px; | ||
| ` | ||
| )} | ||
| `; | ||
| | ||
| const PlaceAndTitleAndRewardsAndCoherency = styled.div` | ||
| display: none; | ||
| | ||
| ${landscapeStyle( | ||
| () => | ||
| css` | ||
| display: flex; | ||
| flex-direction: row; | ||
| gap: calc(20px + (28 - 20) * (min(max(100vw, 375px), 1250px) - 375px) / 875); | ||
| ` | ||
| )} | ||
| `; | ||
| | ||
| const StyledLabel = styled.label` | ||
| ${landscapeStyle( | ||
| () => | ||
| css` | ||
| display: none; | ||
| ` | ||
| )} | ||
| `; | ||
| | ||
| const Header: React.FC = () => { | ||
| return ( | ||
| <Container> | ||
| <StyledLabel>Ranking</StyledLabel> | ||
| <PlaceAndTitleAndRewardsAndCoherency> | ||
| <Rank /> | ||
| <JurorTitle /> | ||
| <Rewards /> | ||
| <Coherency /> | ||
| </PlaceAndTitleAndRewardsAndCoherency> | ||
| <HowItWorks /> | ||
| </Container> | ||
| ); | ||
| }; | ||
| | ||
| export default Header; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.