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

Treasury pages for plugins #162

Open
wants to merge 1 commit into
base: feat/treasury-plugins
Choose a base branch
from
Open
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
522 changes: 269 additions & 253 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ pulldown-cmark = "0.11.0"
blake2 = "0.10.6"
chrono = "0.4.38"
wasm-logger = "0.2.0"
dioxus-charts = "0.2"

[patch.crates-io]
cookie = { git = "https://github.com/S0c5/cookie-rs.git" }
Expand Down
26 changes: 24 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
--text-tertiary: #227A6B;
--text-primary-alt: #FFFFFF;

--text-dark-primary: #0A2925;
--text-dark-secondary: #1C534B;
--text-dark-tertiary: #2BA188;

--fill-00: #E7F7E8;
--fill-50: #C6EBC7;
--fill-100: #A1DFA4;
Expand All @@ -128,6 +132,13 @@
--fill-200-alt: #1D1E1F;
--fill-600-alt: #5F5F5F;

--base-fill-1: #BDF5C4;
--base-fill-2: #89EC96;
--base-fill-5: #197C27;
--base-surface-1: #F0FDF1;
--base-surface-2: #DDFBE0;
--base-border: #89EC96;

--color-blue-300: #52C2E6;
--color-green-100: #C6EBC7;
--color-green-300: #78D37D;
Expand All @@ -143,6 +154,12 @@
--state-destructive-hover: #FF6565;
--state-primary-active: #56C960;
--state-primary-selected: #A1DFA4;
--state-success-active: #61EA94;
--state-brand-primary: #24AF37;

--alpha-500: rgba(26, 26, 26, 0.50);

--operator-message-text: #000000;
}

:root {
Expand Down Expand Up @@ -221,6 +238,12 @@
} from "https://unpkg.com/@virtonetwork/xcm-programs@latest/dist/xcm-programs.js";
import init from "/{base_path}/assets/dioxus/{app_name}.js";

// const executor = new XcmProgramsExecutor({
// kusama: ["ws://localhost:10000"],
// kreivo: ["ws://localhost:12281"],
// kusamaPeople: ["ws://localhost:11004"],
// });

const executor = new XcmProgramsExecutor({
kusama: ["wss://kusama-rpc.dwellir.com", "wss://kusama-rpc-tn.dwellir.com", "wss://kusama-public-rpc.blockops.network/ws"],
kreivo: ["wss://kreivo.io", "wss://kreivo.kippu.rocks/"],
Expand All @@ -236,7 +259,7 @@
};

init("/{base_path}/assets/dioxus/{app_name}_bg.wasm").then(
async (wasm) => {
async (wasm) => {
if (wasm.__wbindgen_start == undefined) {
wasm.main();
}
Expand Down Expand Up @@ -264,7 +287,6 @@
};
}
</script>
{script_include}
</body>

</html>
119 changes: 119 additions & 0 deletions public/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2332,6 +2332,125 @@ textarea::placeholder {
margin-bottom: 48px;
}

.bill,
.send,
.plugins {
padding: 16px;
height: 100%;
min-height: calc(100vh - 140px);
width: 100%;
position: relative;
margin-bottom: 48px;
background: var(--base-surface-1);
}

.treasury {
padding: 24px 16px;
height: 100%;
min-height: calc(100vh - 140px);
width: 100%;
position: relative;
display: flex;
flex-direction: column;
gap: 8px;
background: var(--base-surface-1);
}

.treasury__wrapper {
display: flex;
flex-direction: column;
gap: 16px;
}

.dx-line-path {
stroke: var(--state-success-active);
}

.dx-line-dot {
stroke: var(--state-success-active);
}

.page--ghost .radio-button {
display: flex;
padding: var(--Spacing-space-5, 8px);
justify-content: flex-end;
align-items: flex-start;
gap: var(--Spacing-space-5, 8px);
flex: 1 0 0;
border-radius: var(--radi-6, 12px);
border: var(--stroke-sm, 1px) solid var(--base-border, #89EC96);
background: var(--base-surface-1, #F0FDF1);
box-shadow: 0px 0.5px var(--blur-1, 3px) 0px var(--colors-alpha-dark-50, rgba(26, 26, 26, 0.08));
}

.page--ghost .radio-button__header {
justify-content: unset;
padding: 0;
}

.page--ghost .radio-button__header span {
@extend %text-base-font-medium;
color: var(--text-dark-primary);
}

.page--ghost .input__label {
@extend %text-sm-font-regular;
color: var(--text-dark-secondary);
}

.page--ghost .input--help {
@extend %text-sm-font-regular;
color: var(--text-dark-secondary);
}

.page--ghost .input-wrapper {
display: flex;
padding: 0px var(--spacing-6, 10px) 0px var(--spacing-7, 12px);
align-items: center;
gap: var(--spacing-5, 8px);
align-self: stretch;
border-radius: var(--radi-6, 12px);
border: var(--stroke-sm, 1px) solid var(--base-border, #89EC96);
background: var(--base-surface-1, #F0FDF1);
}

.page--ghost .input {
@extend %text-base-font-medium;
color: var(--text-dark-secondary);
}

.page--ghost .dropdown {
display: flex;
flex-direction: column;
}

.page--ghost .dropdown__label {
@extend %text-sm-font-regular;
color: var(--text-dark-secondary);
}

.page--ghost .dropdown__container {
border-radius: var(--radi-6, 12px);
border: var(--stroke-sm, 1px) solid var(--base-border, #89EC96);
background: var(--base-surface-1, #F0FDF1);
}

.page--ghost .dropdown__placeholder {
@extend %text-sm-font-medium;
color: var(--text-tertiary);
}

.page--ghost input::placeholder,
.page--ghost textarea::placeholder {
@extend %text-sm-font-medium;
color: var(--text-tertiary);
}

.page--ghost .dropdown__value {
@extend %text-base-font-medium;
color: var(--text-secondary);
}

.initiatives {
padding: 16px;
height: 100%;
Expand Down
146 changes: 146 additions & 0 deletions src/components/molecules/invoice.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
use dioxus::prelude::*;

use crate::hooks::use_invoice::{
InvoiceDetails, InvoiceItems, InvoiceTerms, InvoiceTransfer, InvoiceX,
};
#[derive(PartialEq, Props, Clone)]
pub struct InvoiceProps {
logo: String,
from: InvoiceX,
to: InvoiceX,
items: InvoiceItems,
details: InvoiceDetails,
terms: InvoiceTerms,
transfer: InvoiceTransfer,
}
pub fn InvoiceView(props: InvoiceProps) -> Element {
rsx!(
section { class: "invoice",
div { class: "row",
h2 { class: "invoice__title", "Invoice" }
img { class: "invoice__logo",
src: props.logo
}
}
div { class: "invoice__table",
div { class: "row invoice__section",
div { class: "invoice__column",
h6 { class: "invoice__column__title", "From" }
p { class: "invoice__column__content", {props.from.name}}
p { class: "invoice__column__content", {props.from.email}}
p { class: "invoice__column__content", {props.from.address}}
p { class: "invoice__column__content", {props.from.country}}
}
div { class: "invoice__column",
h6 { class: "invoice__column__title", "To" }
p { class: "invoice__column__content", {props.to.name}}
p { class: "invoice__column__content", {props.to.email}}
p { class: "invoice__column__content", {props.to.address}}
p { class: "invoice__column__content", {props.to.country}}
}
div { class: "invoice__column",
h6 { class: "invoice__column__title", "Details" }
p { class: "invoice__column__content--key-value",
span { class: "invoice__column__content", "Invoice no." }
span { class: "invoice__column__content", {props.details.id} }
}
}
}

div { class: "invoice__section",
div { class: "row invoice__row",
h6 { class: "invoice__column__title", "Item" }
h6 { class: "invoice__column__title", "Quantity" }
h6 { class: "invoice__column__title", "Amount" }
}
hr { class: "divider--table" }
for item in props.items.items {
div { class: "row invoice__row",
p { class: "invoice__column__content", {item.description}}
p { class: "invoice__column__content", {item.quantity.to_string()}}
p { class: "invoice__column__content", {format!("${}", item.amount)}}
}
hr { class: "divider--item" }
}
div { class: "row invoice__row",
div { class: "" }
div { class: "invoice__column__tax__title",
{format!("Sales Tax ({}%)", props.details.tax.percent)}
}
div { class: "invoice__column__tax__value",
{format!("${}", props.details.tax.value)}
}
}
hr { class: "divider--item" }
div { class: "row invoice__row",
div { class: "" }
div { class: "invoice__column__total__title",
"Total"
}
div { class: "invoice__column__total__value",
{format!("${}", props.details.total)}
}
}
}

div { class: "invoice__section",
div { class: "row invoice__row",
h6 { class: "invoice__column__title", "Terms" }
h6 { class: "invoice__column__title invoice__column-2x", "Memo" }
}
hr { class: "divider--table" }
div { class: "row invoice__row",
div { class: "invoice__column__content--column",
p { class: "row",
span { class: "invoice__content", "Invoice date" }
span { class: "invoice__content--tertiary", {props.terms.created_at} }
}
p { class: "row",
span { class: "invoice__content", "Due date" }
span { class: "invoice__content--tertiary", {props.terms.payment_at} }
}
p { class: "row",
span { class: "invoice__content", "Pay via" }
span { class: "invoice__content--tertiary", {props.terms.payment_via} }
}
}
p { class: "invoice__column__content invoice__column-2x",
{props.terms.memo}
}
}
}

div { class: "invoice__section",
div { class: "row invoice__row",
h6 { class: "invoice__column__title", "Transfer details" }
}
hr { class: "divider--table" }
div { class: "row invoice__row--unique",
div { class: "invoice__column__content",
p { class: "row",
span { class: "invoice__content", "Bank name" }
span { class: "invoice__content--tertiary", {props.transfer.name} }
}
p { class: "row",
span { class: "invoice__content", "Account name" }
span { class: "invoice__content--tertiary", {props.transfer.account} }
}
p { class: "row",
span { class: "invoice__content", "Account type" }
span { class: "invoice__content--tertiary", {props.transfer.account_type} }
}
p { class: "row",
span { class: "invoice__content", "Account number" }
span { class: "invoice__content--tertiary", {props.transfer.account_number} }
}
p { class: "row",
span { class: "invoice__content", "Routing number" }
span { class: "invoice__content--tertiary", {props.transfer.routing_number} }
}
}
}
}
}
}
)
}
6 changes: 6 additions & 0 deletions src/components/molecules/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@ pub mod action_request_list;
pub mod actions;
pub mod header;
pub mod initiative;
pub mod invoice;
pub mod onboarding;
pub mod paginator;
pub mod sidebar;
pub mod tab;
pub mod tabs;
pub mod treasury;
pub use action_request_list::ActionRequestList;
pub use actions::*;
pub use header::Header;
pub use initiative::*;
pub use invoice::InvoiceView;
pub use onboarding::*;
pub use paginator::Paginator;
pub use sidebar::Sidebar;
pub use tab::Tab;
pub use tabs::Tabs;
pub use treasury::*;
Loading