Skip to content
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

feat: add rules to new proposal page #2290

Merged
merged 2 commits into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 38 additions & 3 deletions src/components/ProposalForm/ProposalForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
useMediaQuery,
useTheme,
Icon,
H3,
Link,
classNames,
Tooltip,
DEFAULT_DARK_THEME_NAME
Expand Down Expand Up @@ -41,11 +43,45 @@ import { isActiveApprovedRfp } from "src/containers/Proposal/helpers";
import useModalContext from "src/hooks/utils/useModalContext";
import FormatHelpButton from "./FormatHelpButton";
import SubmitButton from "./SubmitButton";
import ProposalGuidelinesButton from "./ProposalGuidelinesButton";

/** The main goal of using a Map data structure instead of internal state here is to prevent unnecessary rerenders. We just want a way to map blobs to files objects. */
const mapBlobToFile = new Map();

const ListItem = ({ children }) => (
<li className={styles.listItem}>{children}</li>
);

const Rules = () => (
<>
<H3>Rules:</H3>
<ul className="margin-top-s margin-bottom-m">
<ListItem>
Expenses must be denominated in USD (but will be paid in DCR)
</ListItem>
<ListItem>
The work will be paid next month after the month it was done, as
explained{" "}
<Link
href="https://docs.decred.org/contributing/contributor-compensation/"
target="_blank"
rel="noopener noreferrer">
here
</Link>
</ListItem>
<ListItem>Proposal must include actionable plan</ListItem>
<ListItem>
Check{" "}
<Link
href="https://docs.decred.org/governance/politeia/proposal-guidelines/"
target="_blank"
rel="noopener noreferrer">
Proposal Guidelines
</Link>
</ListItem>
</ul>
</>
);

const ProposalForm = React.memo(function ProposalForm({
values,
handleChange,
Expand Down Expand Up @@ -219,13 +255,13 @@ const ProposalForm = React.memo(function ProposalForm({
onRemove={handleFileRemoval}
errors={errors}
/>
<Rules />
{!smallTablet ? (
<Row topMarginSize="s" justify="right">
<FormatHelpButton
isDarkTheme={isDarkTheme}
openMDGuideModal={openMDGuideModal}
/>
<ProposalGuidelinesButton isDarkTheme={isDarkTheme} />
<DraftSaver
mapBlobToFile={mapBlobToFile}
submitSuccess={submitSuccess}
Expand Down Expand Up @@ -254,7 +290,6 @@ const ProposalForm = React.memo(function ProposalForm({
isDarkTheme={isDarkTheme}
openMDGuideModal={openMDGuideModal}
/>
<ProposalGuidelinesButton isDarkTheme={isDarkTheme} />
</Row>
</>
)}
Expand Down
4 changes: 4 additions & 0 deletions src/components/ProposalForm/ProposalForm.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
margin-top: 2rem;
}

.listItem {
margin-top: 1rem;
}

@media screen and (max-width: 685px) {
.datePicker {
margin-top: 2rem;
Expand Down
19 changes: 0 additions & 19 deletions src/components/ProposalForm/ProposalGuidelinesButton.jsx

This file was deleted.