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

Added theme page and dark theme #196

Merged
merged 25 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 19 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
6 changes: 1 addition & 5 deletions instances/treasury-devdao.near/aliases.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
"REPL_SOCIAL_CONTRACT": "social.near",
"REPL_RPC_URL": "https://rpc.mainnet.near.org",
"REPL_PROPOSALS_CACHE_URL": "https://devhub-cache-api-rs.fly.dev",
"REPL_NEAR_TOKEN_ICON": "https://ipfs.near.social/ipfs/bafkreifnyxk6cssapw7j5vc6zuzwl7vt6o5ddspoo5lcmbvtdrcmfozqyu",
"REPL_PIKESPEAK_KEY": "36f2b87a-7ee6-40d8-80b9-5e68e587a5b5",
"REPL_NEARBLOCKS_KEY": "DA2570E26C0242FF897A463F4DCAACA6",
"REPL_STAKE_ICON": "https://ipfs.near.social/ipfs/bafkreic7bmyuz7wixpmuxi4z37r3vwaix3ad2jlcl4dhes2djj22zmbez4",
"REPL_UNSTAKE_ICON": "https://ipfs.near.social/ipfs/bafkreihrvzrhxeggkcozrmwt7kfiqw4hy56clamfxuq7agownukcn6lfxe",
"REPL_WITHDRAW_ICON": "https://ipfs.near.social/ipfs/bafkreiedu2yjz7abf7b75qsq3e3yqzelyimvowkwc3hy3s4cziohjrxt2m"
"REPL_NEARBLOCKS_KEY": "DA2570E26C0242FF897A463F4DCAACA6"
}
3 changes: 2 additions & 1 deletion instances/treasury-devdao.near/widget/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const { AppLayout } = VM.require(
) || { AppLayout: () => <></> };

const instance = "${REPL_INSTANCE}";
const treasuryDaoID = "${REPL_TREASURY}";

const { Theme } = VM.require(`${instance}/widget/config.css`) || {
Theme: () => <></>,
Expand Down Expand Up @@ -84,7 +85,7 @@ function Page() {

return (
<Theme>
<AppLayout page={page} instance={instance}>
<AppLayout page={page} instance={instance} treasuryDaoID={treasuryDaoID}>
<Page />
</AppLayout>
</Theme>
Expand Down
24 changes: 9 additions & 15 deletions instances/treasury-devdao.near/widget/components/Approvers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@ const Container = styled.div`
.grey-circle {
width: 40px;
height: 40px;
background-color: #e2e6ec;
}

.reject {
color: #d20000;
}

.approve {
color: #089968;
background-color: var(--grey-04);
}
`;

Expand Down Expand Up @@ -95,7 +87,7 @@ return (
<Container className="d-flex justify-content-center">
{showHover ? (
<Widget
src="${REPL_MOB}/widget/N.Common.OverlayTrigger"
src="${REPL_BASE_DEPLOYMENT_ACCOUNT}/widget/components.OverlayTrigger"
props={{
popup: (
<div className="p-1">
Expand Down Expand Up @@ -139,11 +131,12 @@ return (
<div className="d-flex">
{voted ? (
<span
className={
votesStatus === "Approved"
? "approve"
: "reject"
}
style={{
color:
votesStatus === "Approved"
? "#3CB179"
: "#D95C4A",
}}
>
{votesStatus}{" "}
</span>
Expand All @@ -159,6 +152,7 @@ return (
</div>
),
children: ApproversComponent,
instance: props.instance,
}}
/>
) : (
Expand Down
2 changes: 1 addition & 1 deletion instances/treasury-devdao.near/widget/components/Date.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ const formattedTime = date.toLocaleTimeString("en-GB", {
return (
<div className="text-left">
<div className="bold">{formattedTime}</div>
<div className="text-muted text-sm">{formattedDate}</div>
<div className="text-secondary text-sm">{formattedDate}</div>
</div>
);
18 changes: 2 additions & 16 deletions instances/treasury-devdao.near/widget/components/DropDown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,16 @@ const StyledDropdown = styled.div`
padding-inline: 10px;
}

.dropdown-item.active,
.dropdown-item:active {
background-color: #f0f0f0 !important;
color: black;
}

.dropdown-toggle:after {
position: absolute;
top: 45%;
right: 5%;
}

.cursor-pointer {
cursor: pointer;
}

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

.text-muted {
color: rgba(153, 153, 153, 1);
}

.work-break {
border-radius: 5px;
white-space: normal;
Expand All @@ -58,7 +44,7 @@ return (
<div className="dropdown w-100" data-testid="dropdown">
<button
disabled={disabled}
className="btn drop-btn text-truncate dropdown-toggle bg-white border rounded-2"
className="btn drop-btn text-truncate dropdown-toggle bg-dropdown border rounded-2"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
Expand Down Expand Up @@ -89,7 +75,7 @@ return (
)}
</ul>
{selected?.description && (
<div classNameName="text-muted text-sm mt-1">
<div classNameName="text-secondary text-sm mt-1">
{selected.description}
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ const Container = styled.div`
width: 100%;
}

.dropdown-item.active,
.dropdown-item:active {
background-color: #f0f0f0 !important;
color: black;
}

.custom-select {
position: relative;
}
Expand All @@ -101,15 +95,7 @@ const Container = styled.div`
}

.selected {
background-color: #f0f0f0;
}

input {
background-color: #f8f9fa;
}

.cursor-pointer {
cursor: pointer;
background-color: var(--grey-04);
}

.text-wrap {
Expand All @@ -129,10 +115,10 @@ return (
}, 0);
}}
>
<div className="dropdown-toggle bg-white border rounded-2 btn drop-btn">
<div className="dropdown-toggle bg-dropdown border rounded-2 btn drop-btn">
<div
className={`selected-option w-100 text-wrap ${
selectedOption.label === defaultLabel ? "text-muted" : ""
selectedOption.label === defaultLabel ? "text-secondary" : ""
}`}
onClick={toggleDropdown}
>
Expand Down Expand Up @@ -182,7 +168,7 @@ return (
)}
{showManualRequest && (
<div
className="btn cursor-pointer btn-link d-flex gap-2 align-items-center text-decoration-none mt-1"
className="btn primary-text-color cursor-pointer btn-link d-flex gap-2 align-items-center text-decoration-none mt-1"
onClick={() => {
setSelectedOption(null);
onClickOfManualRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ const isPaymentsPage = props.isPaymentsPage;
const Container = styled.div`
text-align: center;
.reject {
background-color: rgba(0, 0, 0, 0.08);
color: #1b1b18;
background-color: var(--grey-04);
color: var(--text-color);
}

.approve {
background-color: rgba(0, 202, 134, 0.16);
color: #089968;
color: var(--other-green);
}

.expire {
background-color: rgba(255, 122, 0, 0.16);
color: #de6a00;
color: var(--other-warning);
}

.failed {
background-color: rgba(239, 56, 38, 0.1);
color: #ef3826;
color: var(--other-red);
}
`;

Expand Down
Loading
Loading