Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup
Browse files Browse the repository at this point in the history
Megha-Dev-19 committed Dec 30, 2024
1 parent 6bcdfa7 commit 593b52f
Showing 19 changed files with 83 additions and 255 deletions.
4 changes: 0 additions & 4 deletions instances/treasury-devdao.near/widget/components/DropDown.jsx
Original file line number Diff line number Diff line change
@@ -24,10 +24,6 @@ const StyledDropdown = styled.div`
right: 5%;
}
.cursor-pointer {
cursor: pointer;
}
.text-sm {
font-size: 12px !important;
}
Original file line number Diff line number Diff line change
@@ -98,10 +98,6 @@ const Container = styled.div`
background-color: var(--grey-04);
}
.cursor-pointer {
cursor: pointer;
}
.text-wrap {
overflow: hidden;
white-space: normal;
Original file line number Diff line number Diff line change
@@ -107,14 +107,6 @@ const Container = styled.div`
.custom-select {
position: relative;
}
.cursor-pointer {
cursor: pointer;
}
.text-sm {
font-size: 13px;
}
`;

const Item = ({ option }) => {
Original file line number Diff line number Diff line change
@@ -163,10 +163,6 @@ const Container = styled.div`
background-color: var(--grey-04);
}
.cursor-pointer {
cursor: pointer;
}
.text-wrap {
overflow: hidden;
white-space: normal;
Original file line number Diff line number Diff line change
@@ -74,10 +74,6 @@ const Container = styled.div`
background-color: var(--grey-04);
}
.cursor-pointer {
cursor: pointer;
}
.text-wrap {
overflow: hidden;
white-space: normal;
Original file line number Diff line number Diff line change
@@ -350,6 +350,10 @@ function AppLayout({ page, instance, children, treasuryDaoID }) {
.border-right {
border-right: 1px solid var(--border-color);
}
.cursor-pointer {
cursor: pointer;
}
`;

return (
Original file line number Diff line number Diff line change
@@ -226,10 +226,6 @@ const Container = styled.div`
}
}
.cursor-pointer {
cursor: pointer;
}
table {
overflow-x: auto;
}
Original file line number Diff line number Diff line change
@@ -208,9 +208,6 @@ const Container = styled.div`
color: black !important;
}
.text-sm {
font-size: 13px;
}
.warning {
background-color: rgba(255, 158, 0, 0.1);
color: #ff9e00;
14 changes: 2 additions & 12 deletions instances/treasury-devdao.near/widget/pages/payments/Table.jsx
Original file line number Diff line number Diff line change
@@ -70,16 +70,6 @@ const Container = styled.div`
}
`;

const ToastContainer = styled.div`
a {
color: black !important;
text-decoration: underline !important;
&:hover {
color: black !important;
}
}
`;

function checkProposalStatus(proposalId) {
Near.asyncView(treasuryDaoID, "get_proposal", {
id: proposalId,
@@ -210,15 +200,15 @@ const VoteSuccessToast = () => {
return showToastStatus &&
(typeof voteProposalId === "number" ||
typeof highlightProposalId === "number") ? (
<ToastContainer className="toast-container position-fixed bottom-0 end-0 p-3">
<div className="toast-container position-fixed bottom-0 end-0 p-3">
<div className={`toast ${showToastStatus ? "show" : ""}`}>
<div className="toast-header px-2">
<strong className="me-auto">Just Now</strong>
<i className="bi bi-x-lg h6" onClick={() => setToastStatus(null)}></i>
</div>
<ToastStatusContent />
</div>
</ToastContainer>
</div>
) : null;
};

Original file line number Diff line number Diff line change
@@ -56,16 +56,6 @@ const Container = styled.div`
}
`;

const ToastContainer = styled.div`
a {
color: black !important;
text-decoration: underline !important;
&:hover {
color: black !important;
}
}
`;

function checkProposalStatus(proposalId) {
Near.asyncView(treasuryDaoID, "get_proposal", {
id: proposalId,
@@ -180,15 +170,15 @@ const VoteSuccessToast = () => {
return showToastStatus &&
(typeof voteProposalId === "number" ||
typeof highlightProposalId === "number") ? (
<ToastContainer className="toast-container position-fixed bottom-0 end-0 p-3">
<div className="toast-container position-fixed bottom-0 end-0 p-3">
<div className={`toast ${showToastStatus ? "show" : ""}`}>
<div className="toast-header px-2">
<strong className="me-auto">Just Now</strong>
<i className="bi bi-x-lg h6" onClick={() => setToastStatus(null)}></i>
</div>
<ToastStatusContent />
</div>
</ToastContainer>
</div>
) : null;
};

Original file line number Diff line number Diff line change
@@ -113,20 +113,10 @@ useEffect(() => {
}
}, [currentPage, rowsPerPage, allMembers]);

const ToastContainer = styled.div`
a {
color: black !important;
text-decoration: underline !important;
&:hover {
color: black !important;
}
}
`;

const SubmitToast = () => {
return (
showToastStatus && (
<ToastContainer className="toast-container position-fixed bottom-0 end-0 p-3">
<div className="toast-container position-fixed bottom-0 end-0 p-3">
<div className={`toast ${showToastStatus ? "show" : ""}`}>
<div className="toast-header px-2">
<strong className="me-auto">Just Now</strong>
@@ -149,7 +139,7 @@ const SubmitToast = () => {
</a>
</div>
</div>
</ToastContainer>
</div>
)
);
};
Original file line number Diff line number Diff line change
@@ -79,18 +79,10 @@ const Container = styled.div`
background-color: var(--grey-04);
}
.cursor-pointer {
cursor: pointer;
}
.text-wrap {
overflow: hidden;
white-space: normal;
}
.text-sm {
font-size: 13px;
}
`;

const handleOptionClick = (option) => {
107 changes: 63 additions & 44 deletions instances/treasury-devdao.near/widget/pages/settings/Theme.jsx
Original file line number Diff line number Diff line change
@@ -27,59 +27,19 @@ const [image, setImage] = useState(defaultImage);
const [color, setColor] = useState(defaultColor);
const [selectedTheme, setSelectedTheme] = useState(ThemeOptions[0]);
const [error, setError] = useState(null);
const [isTxnCreated, setTxnCreated] = useState(false);
const [showToastStatus, setToastStatus] = useState(false);
const [lastProposalId, setLastProposalId] = useState(null);

const Container = styled.div`
max-width: 50rem;
font-size: 14px;
.card-title {
font-size: 18px;
font-weight: 600;
padding-block: 5px;
border-bottom: 1px solid var(--border-color);
}
.selected-role {
background-color: var(--grey-04);
}
.cursor-pointer {
cursor: pointer;
}
.tag {
background-color: var(--grey-04);
font-size: 12px;
padding-block: 5px;
}
label {
color: rgba(153, 153, 153, 1);
color: var(--text-secondary);
font-size: 12px;
}
.fw-bold {
font-weight: 500 !important;
}
.p-0 {
padding: 0 !important;
}
.text-md {
font-size: 13px;
}
.warning {
background-color: rgba(255, 158, 0, 0.1);
color: var(--other-warning);
font-weight: 500;
}
.text-sm {
font-size: 12px !important;
}
.error-message {
color: #d95c4a;
background-color: rgba(217, 92, 74, 0.08);
@@ -222,11 +182,69 @@ const code = `
</html>
`;

const SubmitToast = () => {
return (
showToastStatus && (
<div className="toast-container position-fixed bottom-0 end-0 p-3">
<div className={`toast ${showToastStatus ? "show" : ""}`}>
<div className="toast-header px-2">
<strong className="me-auto">Just Now</strong>
<i
className="bi bi-x-lg h6"
onClick={() => setToastStatus(null)}
></i>
</div>
<div className="toast-body">
<div>Theme change request submitted.</div>
<a
href={href({
widgetSrc: `${instance}/widget/app`,
params: {
page: "settings",
},
})}
>
View it
</a>
</div>
</div>
</div>
)
);
};

function getLastProposalId() {
return Near.asyncView(treasuryDaoID, "get_last_proposal_id").then(
(result) => result
);
}

useEffect(() => {
getLastProposalId().then((i) => setLastProposalId(i));
}, []);

useEffect(() => {
if (isTxnCreated) {
const checkForNewProposal = () => {
getLastProposalId().then((id) => {
if (lastProposalId !== id) {
setToastStatus(true);
setTxnCreated(false);
} else {
setTimeout(() => checkForNewProposal(), 1000);
}
});
};
checkForNewProposal();
}
}, [isTxnCreated]);

function toBase64(json) {
return Buffer.from(JSON.stringify(json)).toString("base64");
}

function onSubmitClick() {
setTxnCreated(true);
const deposit = daoPolicy?.proposal_bond || 100000000000000000000000;

const description = {
@@ -276,6 +294,7 @@ useEffect(() => {

return (
<Container>
<SubmitToast />
<div className="card rounded-3 w-100 h-100 p-3">
{!metadata ? (
<div
Original file line number Diff line number Diff line change
@@ -117,10 +117,6 @@ const Container = styled.div`
background-color: var(--grey-04);
}

.cursor-pointer {
cursor: pointer;
}

.tag {
background-color: var(--grey-04);
font-size: 12px;
@@ -132,10 +128,6 @@ const Container = styled.div`
font-size: 12px;
}

.fw-bold {
font-weight: 500 !important;
}

.p-0 {
padding: 0 !important;
}
@@ -154,34 +146,11 @@ const Container = styled.div`
font-size: 12px !important;
}

.text-red {
color: #d95c4a;
}

.toast {
background: white !important;
}

.toast-header {
background-color: var(--other-primary) !important;
color: white !important;
}

.dropdown-toggle:after {
top: 20% !important;
}
`;

const ToastContainer = styled.div`
a {
color: black !important;
text-decoration: underline !important;
&:hover {
color: black !important;
}
}
`;

const proposalKinds = [
"config",
"policy",
@@ -255,7 +224,7 @@ function onSubmitClick() {
const SubmitToast = () => {
return (
showToastStatus && (
<ToastContainer className="toast-container position-fixed bottom-0 end-0 p-3">
<div className="toast-container position-fixed bottom-0 end-0 p-3">
<div className={`toast ${showToastStatus ? "show" : ""}`}>
<div className="toast-header px-2">
<strong className="me-auto">Just Now</strong>
@@ -278,7 +247,7 @@ const SubmitToast = () => {
</a>
</div>
</div>
</ToastContainer>
</div>
)
);
};
Original file line number Diff line number Diff line change
@@ -60,69 +60,10 @@ const Container = styled.div`
border-bottom: 1px solid var(--border-color);
}

.selected-role {
background-color: var(--grey-04);
}

.cursor-pointer {
cursor: pointer;
}

.tag {
background-color: var(--grey-04);
font-size: 12px;
padding-block: 5px;
}

label {
color: rgba(153, 153, 153, 1);
color: var(--text-secondary);
font-size: 12px;
}

.fw-bold {
font-weight: 500 !important;
}

.p-0 {
padding: 0 !important;
}

.text-md {
font-size: 13px;
}

.warning {
background-color: rgba(255, 158, 0, 0.1);
color: var(--other-warning);
font-weight: 500;
}

.text-sm {
font-size: 12px !important;
}

.text-red {
color: #d95c4a;
}

.toast {
background: white !important;
}

.toast-header {
background-color: var(--other-primary) !important;
color: white !important;
}
`;

const ToastContainer = styled.div`
a {
color: black !important;
text-decoration: underline !important;
&:hover {
color: black !important;
}
}
`;

const cancelChangeRequest = () => {
@@ -523,7 +464,7 @@ return (
</div>
</div>
</div>
<ToastContainer className="toast-container position-fixed bottom-0 end-0 p-3">
<div className="toast-container position-fixed bottom-0 end-0 p-3">
<div className={`toast ${showToastStatus ? "show" : ""}`}>
<div className="toast-header px-2">
<strong className="me-auto">Just Now</strong>
@@ -543,6 +484,6 @@ return (
</a>
</div>
</div>
</ToastContainer>
</div>
</Container>
);
Original file line number Diff line number Diff line change
@@ -80,14 +80,6 @@ const Container = styled.div`
.custom-select {
position: relative;
}

.cursor-pointer {
cursor: pointer;
}

.text-sm {
font-size: 13px;
}
`;

const Item = ({ option }) => {
Original file line number Diff line number Diff line change
@@ -66,16 +66,6 @@ const Container = styled.div`
}
`;

const ToastContainer = styled.div`
a {
color: black !important;
text-decoration: underline !important;
&:hover {
color: black !important;
}
}
`;

function checkProposalStatus(proposalId) {
Near.asyncView(treasuryDaoID, "get_proposal", {
id: proposalId,
@@ -202,15 +192,15 @@ const VoteSuccessToast = () => {
return showToastStatus &&
(typeof voteProposalId === "number" ||
typeof highlightProposalId === "number") ? (
<ToastContainer className="toast-container position-fixed bottom-0 end-0 p-3">
<div className="toast-container position-fixed bottom-0 end-0 p-3">
<div className={`toast ${showToastStatus ? "show" : ""}`}>
<div className="toast-header px-2">
<strong className="me-auto">Just Now</strong>
<i className="bi bi-x-lg h6" onClick={() => setToastStatus(null)}></i>
</div>
<ToastStatusContent />
</div>
</ToastContainer>
</div>
) : null;
};

Original file line number Diff line number Diff line change
@@ -91,14 +91,6 @@ const Container = styled.div`
.custom-select {
position: relative;
}

.cursor-pointer {
cursor: pointer;
}

.text-sm {
font-size: 13px;
}
`;

const Item = ({ option }) => {
Original file line number Diff line number Diff line change
@@ -105,17 +105,7 @@ const Container = styled.div`
color: inherit !important;
}
`;

const ToastContainer = styled.div`
a {
color: black !important;
text-decoration: underline !important;
&:hover {
color: black !important;
}
}
`;

div;
function checkProposalStatus(proposalId) {
Near.asyncView(treasuryDaoID, "get_proposal", {
id: proposalId,
@@ -240,15 +230,15 @@ const VoteSuccessToast = () => {
return showToastStatus &&
(typeof voteProposalId === "number" ||
typeof highlightProposalId === "number") ? (
<ToastContainer className="toast-container position-fixed bottom-0 end-0 p-3">
<div className="toast-container position-fixed bottom-0 end-0 p-3">
<div className={`toast ${showToastStatus ? "show" : ""}`}>
<div className="toast-header px-2">
<strong className="me-auto">Just Now</strong>
<i className="bi bi-x-lg h6" onClick={() => setToastStatus(null)}></i>
</div>
<ToastStatusContent />
</div>
</ToastContainer>
</div>
) : null;
};

0 comments on commit 593b52f

Please sign in to comment.