From 470b64c0f1c14ed25a480a18949eab7502a26e2c Mon Sep 17 00:00:00 2001 From: Zeeshan Ahmad Date: Tue, 30 Jan 2024 01:20:29 +0500 Subject: [PATCH 1/2] Add css variables and props for custom styling --- apps/builddao/widget/components/Modal.jsx | 6 ++-- .../components/modals/CreateProposal.jsx | 14 ++++++++- .../components/modals/propose/AddMember.jsx | 18 +++++++----- .../modals/propose/FunctionCall.jsx | 29 ++++++++++--------- .../modals/propose/RemoveMember.jsx | 18 +++++++----- .../components/modals/propose/Transfer.jsx | 20 +++++++------ 6 files changed, 63 insertions(+), 42 deletions(-) diff --git a/apps/builddao/widget/components/Modal.jsx b/apps/builddao/widget/components/Modal.jsx index 65d551f5..62c857ce 100644 --- a/apps/builddao/widget/components/Modal.jsx +++ b/apps/builddao/widget/components/Modal.jsx @@ -14,7 +14,7 @@ const Overlay = styled.div` z-index: 1000; width: 100vw; height: 100vh; - background: rgba(11, 12, 20, 0.5); + background: var(--modal-overlay-color, rgba(11, 12, 20, 0.5)); `; const Content = styled.div` @@ -22,9 +22,9 @@ const Content = styled.div` max-width: 1000px; padding: 24px; outline: none !important; - background: #23242b; + background: var(--modal-background-color, #23242b); border-radius: 16px; - color: white; + color: var(--modal-text-color, #fff); @media screen and (max-width: 768px) { width: 80%; diff --git a/apps/builddao/widget/components/modals/CreateProposal.jsx b/apps/builddao/widget/components/modals/CreateProposal.jsx index 822a96ab..a32f224f 100644 --- a/apps/builddao/widget/components/modals/CreateProposal.jsx +++ b/apps/builddao/widget/components/modals/CreateProposal.jsx @@ -15,6 +15,9 @@ const { Modal, Button, User } = VM.require( const showModal = props.showModal; const toggleModal = props.toggleModal; const toggle = props.toggle; +const bootstrapTheme = props.bootstrapTheme || "dark"; +const editorCSS = props.editorCSS; + if (!showModal) { return ""; } @@ -102,7 +105,7 @@ return ( setRole(e.target.value)} selected={role} @@ -207,10 +209,10 @@ return ( src="mob.near/widget/MarkdownEditorIframe" props={{ initialText: text, - embedCss: MarkdownEditor, + embedCss: props.customCSS || MarkdownEditor, onChange: (v) => { setText(v); - } + }, }} /> @@ -228,10 +230,10 @@ return ( kind: { AddMemberToRole: { member_id: accountId, - role: role - } - } - } + role: role, + }, + }, + }, }) } > diff --git a/apps/builddao/widget/components/modals/propose/FunctionCall.jsx b/apps/builddao/widget/components/modals/propose/FunctionCall.jsx index 2d661c87..7ed6ca9b 100644 --- a/apps/builddao/widget/components/modals/propose/FunctionCall.jsx +++ b/apps/builddao/widget/components/modals/propose/FunctionCall.jsx @@ -9,6 +9,9 @@ const [deposit, useDeposit] = useState(0); const [text, setText] = useState(""); const [editorKey, setEditorKey] = useState(0); + +const bootstrapTheme = props.bootstrapTheme; + useEffect(() => { if (!props.item) { return; @@ -158,7 +161,7 @@ return ( setContract(e.target.value)} className="form-control" @@ -171,7 +174,7 @@ return ( setMethod(e.target.value)} className="form-control" @@ -182,7 +185,7 @@ return (