-
Notifications
You must be signed in to change notification settings - Fork 120
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
75 changed files
with
2,108 additions
and
1,280 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
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
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
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 |
---|---|---|
|
@@ -8,5 +8,6 @@ | |
@media screen and (max-width: 1179px) { | ||
.body { | ||
padding-left: 20px; | ||
padding-right: 20px; | ||
} | ||
} |
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
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
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
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
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,48 @@ | ||
import { classNames } from "pi-ui"; | ||
import styles from "./AgendaDetails.module.css"; | ||
import { FormattedMessage as T } from "react-intl"; | ||
import { useAgendaDetails } from "./hooks"; | ||
import { VoteSection, AgendaCard } from "./helpers"; | ||
|
||
const AgendaDetails = () => { | ||
const { | ||
agenda, | ||
selectedChoice, | ||
newSelectedChoice, | ||
setNewSelectedChoice, | ||
choices, | ||
isLoading, | ||
goBackHistory, | ||
updatePreferences | ||
} = useAgendaDetails(); | ||
return ( | ||
<div> | ||
<div className={classNames(styles.cardWrapper)}> | ||
<div | ||
className={classNames(styles.backButton, "flex-centralize")} | ||
onClick={goBackHistory}> | ||
<div className={styles.backArrow}></div> | ||
</div> | ||
<AgendaCard {...{ agenda, selectedChoice }} /> | ||
</div> | ||
<VoteSection | ||
{...{ | ||
choices, | ||
selected: newSelectedChoice, | ||
setSelected: setNewSelectedChoice, | ||
finished: agenda.finished, | ||
isLoading, | ||
updatePreferences | ||
}} | ||
/> | ||
<div className={styles.detailsText}> | ||
<T | ||
id="agenda.overviewDescription" | ||
m="Once the majority of the PoW miners have upgraded (95% of the 1000 most recent blocks are at the latest version) and the majority of the PoS miners have upgraded (75% of the votes in a 2016 block interval), the voting process begins." | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AgendaDetails; |
74 changes: 74 additions & 0 deletions
74
app/components/views/AgendaDetailsPage/AgendaDetails.module.css
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,74 @@ | ||
.cardWrapper { | ||
display: flex; | ||
} | ||
|
||
.backButton { | ||
width: 40px; | ||
background-color: var(--governance-nav-button-bg); | ||
cursor: pointer; | ||
} | ||
|
||
.backButton:hover { | ||
background-color: var(--grey-5); | ||
} | ||
|
||
.backArrow { | ||
height: 10px; | ||
width: 10px; | ||
background-image: var(--menu-arrow-up); | ||
background-position: 50% 5px; | ||
background-repeat: no-repeat; | ||
transform: rotate(-90deg); | ||
} | ||
|
||
.backButton:hover .backArrow { | ||
background-image: var(--arrow-left-white); | ||
transform: rotate(0); | ||
background-position: 50% 0; | ||
} | ||
.column { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-end; | ||
} | ||
|
||
.detailsText { | ||
font-family: var(--font-family-regular-semi-bold); | ||
padding: 30px 40px; | ||
background-color: var(--background-back-color); | ||
margin: 5px 0 20px 0; | ||
border-top: 1px solid var(--tabbed-page-header-bg); | ||
width: 764px; | ||
font-size: 16px; | ||
} | ||
|
||
.piButtonWrapper { | ||
display: flex; | ||
justify-content: flex-end; | ||
width: 740px; | ||
} | ||
|
||
.loadingPage { | ||
width: 100%; | ||
text-align: center; | ||
} | ||
|
||
.piButton { | ||
border: 0 !important; | ||
text-decoration: none !important; | ||
color: var(--color-white) !important; | ||
font-weight: var(--font-weight-semi-bold) !important; | ||
} | ||
|
||
@media screen and (max-width: 1179px) { | ||
.detailsText { | ||
width: 674px; | ||
} | ||
} | ||
|
||
@media screen and (max-width: 768px) { | ||
.detailsText { | ||
padding-left: 20px; | ||
width: 355px; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
app/components/views/AgendaDetailsPage/AgendaDetailsPage.jsx
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,13 @@ | ||
import AgendaDetails from "./AgendaDetails"; | ||
import { Header } from "./helpers"; | ||
import { StandalonePage } from "layout"; | ||
|
||
const AgendaDetailsPage = () => { | ||
return ( | ||
<StandalonePage header={<Header />}> | ||
<AgendaDetails /> | ||
</StandalonePage> | ||
); | ||
}; | ||
|
||
export default AgendaDetailsPage; |
72 changes: 72 additions & 0 deletions
72
app/components/views/AgendaDetailsPage/helpers/AgendaCard/AgendaCard.jsx
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,72 @@ | ||
import styles from "./AgendaCard.module.css"; | ||
import { classNames, Tooltip, StatusTag } from "pi-ui"; | ||
import { FormattedMessage as T } from "react-intl"; | ||
|
||
const AgendaCard = ({ agenda, selectedChoice, className }) => { | ||
const inProgress = !agenda.finished; | ||
|
||
return ( | ||
<div className={classNames(styles.overview, className)}> | ||
<div className={styles.row}> | ||
<div className="flex-column"> | ||
<div className={styles.titleText}>{agenda.name}</div> | ||
<div className={styles.agendaId}> | ||
<T | ||
id="agenda.overview.idLabel" | ||
m="Agenda ID: {name}" | ||
values={{ | ||
name: <strong>{agenda.name}</strong> | ||
}} | ||
/> | ||
</div> | ||
<div className={styles.description}>{`${agenda.description} `}</div> | ||
</div> | ||
<div className={classNames("flex-column", "align-end")}> | ||
{!inProgress ? ( | ||
<Tooltip | ||
contentClassName={styles.tooltipContent} | ||
content={ | ||
<T | ||
id="agenda.card.finishedTooltip" | ||
m="This agenda has finished voting and {passed}." | ||
values={{ passed: agenda.passed ? "PASSED" : "NOT PASSED" }} | ||
/> | ||
}> | ||
<StatusTag | ||
className={styles.statusTag} | ||
type="greenCheck" | ||
text="Finished" | ||
/> | ||
</Tooltip> | ||
) : ( | ||
<Tooltip | ||
contentClassName={styles.tooltipContent} | ||
content={ | ||
<T | ||
id="agenda.card.inProgressTooltip" | ||
m="Voting is still in progress." | ||
/> | ||
}> | ||
<StatusTag | ||
className={styles.statusTag} | ||
type="bluePending" | ||
text="In Progress" | ||
/> | ||
</Tooltip> | ||
)} | ||
<div className={styles.preference}> | ||
<T | ||
id="agenda.card.preference" | ||
m="Preference: {selectedChoice}" | ||
values={{ | ||
selectedChoice: <span>{selectedChoice}</span> | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AgendaCard; |
Oops, something went wrong.