Skip to content

Commit

Permalink
Merge pull request #490 from persistenceOne/sanity_fixes
Browse files Browse the repository at this point in the history
terms modal
  • Loading branch information
blackpanther1881 authored Nov 10, 2023
2 parents 3735a58 + 369d6d2 commit d46e2db
Show file tree
Hide file tree
Showing 10 changed files with 914 additions and 535 deletions.
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
fetchTokenizedShareRewards,
fetchTokenizedShares
} from "./store/actions/tokenizeShares";
import ModalTerms from "./containers/TermsModal";

const SENTRY_API = process.env.REACT_APP_SENTRY_API;
const GOOGLE_ANALYTICS = process.env.REACT_APP_GA_TRACKING_ID;
Expand Down Expand Up @@ -204,6 +205,7 @@ const Main = () => {
})}
<Route component={RouteNotFound} />
</Switch>
<ModalTerms />
</>
);
};
Expand Down
54 changes: 54 additions & 0 deletions src/assets/scss/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/assets/scss/index.css.map

Large diffs are not rendered by default.

76 changes: 75 additions & 1 deletion src/assets/scss/views/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -523,4 +523,78 @@
position: sticky;
top: 0;
}
}
}

.terms-modal {
background: #00000099;
backdrop-filter: blur(2px);
.modal-dialog {
max-width: 720px !important;
}

.modal-content {
border-radius: 0;
background: #282828;
.heading{
color: #FCFCFC;
font-size: 24px;
font-weight: 600;
}
}
.modal-body{
padding: 0 40px;
.content{
max-height: 400px !important;
overflow-y: auto;
input[type="checkbox"] {
accent-color: #c73238;
width: 18px;
height: 18px;
}
.sub-heading{
margin-bottom: 8px;
color: #ECECEC;
span{
font-weight: 600;
}
}
.check-box{
display: flex;
align-items: center;
margin-bottom: 12px;
label{
margin-right: 16px;
margin-bottom: -4px;
}
.text{
color: #E0E0E0;
font-size: 14px;
margin: 0;
}
}
}
.button-primary{
width: 200px;
}
}

.modal-header {
justify-content: center;

button.close {
display: none;
top: 45px;
color: #94979b;
}

p {
font-family: 'Poppins', sans-serif;
font-weight: 600;
font-size: 18px;
line-height: 150%;
text-align: center;
color: #2E3239;
margin: 0;
}
}
}
166 changes: 166 additions & 0 deletions src/containers/TermsModal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
import React, { useEffect, useState } from "react";
import { Modal } from "react-bootstrap";

const ModalTerms = () => {
const [show, setShow] = useState(false);
const [checkBox1, setCheckBox1] = useState(false);
const [checkBox2, setCheckBox2] = useState(false);
const [checkBox3, setCheckBox3] = useState(false);
const [checkAll, setCheckAll] = useState(false);

useEffect(() => {
if (sessionStorage.getItem("terms-conditions") === "disabled") {
setShow(false);
} else {
setShow(true);
}
}, []);

const handleClose = () => {
sessionStorage.setItem("terms-conditions", "disabled");
setShow(false);
};

const handleCheckBox = (evt) => {
setCheckAll((state) => !state);
setCheckBox1(evt.target.checked),
setCheckBox2(evt.target.checked),
setCheckBox3(evt.target.checked);
};

return (
<div>
<Modal
show={show}
onHide={handleClose}
centered
backdrop={false}
className="terms-modal modal-custom "
>
<Modal.Header className="info-modal-header " closeButton>
<p className={"heading"}>Terms & Privacy policy</p>
</Modal.Header>
<Modal.Body className="pt-3 pb-3">
<div className="content">
<p className={"sub-heading"}>
<span className={"font-medium"}>Important Disclaimer:</span>{" "}
Before proceeding, please confirm your agreement to the terms by
checking the boxes below. If you do not agree, please leave the
website:
</p>
<div className={"check-box"}>
<label>
<input
type="checkbox"
checked={checkBox1}
onChange={() => {
setCheckBox1((state) => !state);
if (checkAll) {
setCheckAll(false);
}
}}
/>
</label>
<p className={"text"}>
I have read and understood, and hereby agree to be legally bound
as a ‘User’ to all the terms contained in the{" "}
<a
href="https://persistence.one/terms"
target="_blank"
rel="noreferrer"
className={"underline"}
>
Terms and Conditions
</a>
(including the{" "}
<a
href="https://persistence.one/privacy"
target="_blank"
rel="noreferrer"
className={"underline"}
>
Privacy Policy
</a>
) without qualification.
</p>
</div>
<div className={"check-box"}>
<label>
<input
type="checkbox"
checked={checkBox2}
onChange={() => {
setCheckBox2((state) => !state);
if (checkAll) {
setCheckAll(false);
}
}}
/>
</label>
<p className={"text"}>
I declare that I am not an Excluded Person as defined in the{" "}
<a
href="https://persistence.one/terms"
target="_blank"
rel="noreferrer"
className={"underline"}
>
Terms and Conditions.
</a>
</p>
</div>
<div className={"check-box"}>
<label>
<input
type="checkbox"
checked={checkBox3}
onChange={() => {
setCheckBox3((state) => !state);
if (checkAll) {
setCheckAll(false);
}
}}
/>
</label>
<p className={"text"}>
I agree that my use and continued use of this site is subject to
my continued agreement to the prevailing{" "}
<a
href="https://persistence.one/terms"
target="_blank"
rel="noreferrer"
className={"underline"}
>
Terms and Conditions
</a>{" "}
(which may change from time to time) and will apply to all
actions I take on the site without requiring my confirmation in
each specific instance.
</p>
</div>
<div className={"check-box"}>
<label>
<input
type="checkbox"
checked={checkBox1 && checkBox2 && checkBox3}
onChange={handleCheckBox}
/>
</label>
<p className={"text"}>Select All</p>
</div>
</div>
<div className="text-center mb-4">
<button
className="button button-primary"
disabled={!checkBox1 || !checkBox2 || !checkBox3}
onClick={handleClose}
>
Continue
</button>
</div>
</Modal.Body>
</Modal>
</div>
);
};
export default ModalTerms;
Loading

0 comments on commit d46e2db

Please sign in to comment.