Skip to content

Commit

Permalink
Merge branch 'main' into update-wallet-page
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-medicala-yral authored Dec 17, 2024
2 parents 8dd528f + 58bc6f1 commit 9a12aa2
Show file tree
Hide file tree
Showing 16 changed files with 635 additions and 309 deletions.
19 changes: 13 additions & 6 deletions ssr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,16 @@ speedate = { version = "0.14.4", optional = true }
urlencoding = "2.1.3"
yral-types = { git = "https://github.com/yral-dapp/yral-common.git", rev = "5e4414a3f1e0644d93f181949d533c6a9991da04" }
yral-qstash-types = { git = "https://github.com/yral-dapp/yral-common.git", rev = "5e4414a3f1e0644d93f181949d533c6a9991da04" }
yral-canisters-client = { git = "https://github.com/yral-dapp/yral-common.git", rev = "5e4414a3f1e0644d93f181949d533c6a9991da04", features = ["full"] }
yral-canisters-common = { git = "https://github.com/yral-dapp/yral-common.git", rev = "5e4414a3f1e0644d93f181949d533c6a9991da04" }
yral-canisters-client = { git = "https://github.com/yral-dapp/yral-common.git", rev = "5e4414a3f1e0644d93f181949d533c6a9991da04", features = [
"full",
] }
yral-canisters-common = { git = "https://github.com/yral-dapp/yral-common.git", rev = "5e4414a3f1e0644d93f181949d533c6a9991da04" }
pulldown-cmark = "0.12.1"
ic-certification = "2.6.0"
ciborium = "0.2.2"
yral-metadata-client = { git = "https://github.com/yral-dapp/yral-metadata", rev = "56e3f1f1f5f452673bee17739520c800c1264295", optional = true }
yral-metadata-types = { git = "https://github.com/yral-dapp/yral-metadata", rev = "56e3f1f1f5f452673bee17739520c800c1264295", optional = true }


[build-dependencies]
tonic-build = { version = "0.12.0", default-features = false, features = [
"prost",
Expand All @@ -133,7 +134,7 @@ hydrate = [
"reqwest/native-tls",
"dep:rand_chacha",
"tonic/codegen",
"speedate"
"speedate",
]
ssr = [
"dep:axum",
Expand Down Expand Up @@ -162,7 +163,7 @@ ssr = [
"tonic/tls-webpki-roots",
"tonic/transport",
"tonic-build/transport",
"speedate"
"speedate",
]
# Fetch mock referral history instead of history via canister
mock-referral-history = ["dep:rand_chacha", "k256/arithmetic"]
Expand Down Expand Up @@ -209,7 +210,13 @@ local-bin = [
"dep:yral-metadata-client",
"dep:yral-metadata-types",
]
local-lib = ["hydrate", "redis-kv", "local-auth", "backend-admin", "yral-canisters-common/local"]
local-lib = [
"hydrate",
"redis-kv",
"local-auth",
"backend-admin",
"yral-canisters-common/local",
]

[package.metadata.leptos]
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
Expand Down
130 changes: 130 additions & 0 deletions ssr/src/component/buttons.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
use leptos::*;

#[component]
pub fn HighlightedButton(
children: Children,
on_click: impl Fn() + 'static,
#[prop(optional)] classes: String,
#[prop(optional)] alt_style: Signal<bool>,
#[prop(optional)] disabled: Signal<bool>,
) -> impl IntoView {
let on_click = move |_| on_click();
view! {
<button
on:click=on_click
disabled=move ||disabled.get()
class=move || format!(
"w-full px-5 py-3 rounded-lg disabled:text-white/50 flex items-center transition-all justify-center gap-8 font-kumbh font-bold {} {}",
if alt_style.get() {
"text-primary-600"
} else {
"text-white"
},
classes,
)
style=move || format!(
"background: linear-gradient(73deg, {} );",
if disabled.get() {
"#DE98BE 0%, #E761A9 33%, #7B5369 100%"
} else if alt_style.get() {
"#FFF 0%, #FFF 1000%"
} else {
"#DA539C 0%, #E2017B 33%, #5F0938 100%"
},
)
>
{children()}
</button>
}
}

#[component]
pub fn HighlightedLinkButton(
children: Children,
href: String,
#[prop(optional)] classes: String,
#[prop(optional)] alt_style: Signal<bool>,
#[prop(optional)] disabled: Signal<bool>,
) -> impl IntoView {
view! {
<a
href=href
disabled=move || disabled.get()
class=move ||format!(
"w-full px-5 py-3 rounded-lg {} disabled:text-white/50 flex items-center transition-all justify-center gap-8 font-kumbh font-bold {}",
if alt_style.get() {
"text-primary-600"
} else {
"text-white"
},
classes,
)
style=move || format!(
"background: linear-gradient(73deg, {} );",
if disabled.get() {
"#DE98BE 0%, #E761A9 33%, #7B5369 100%"
} else if alt_style.get() {
"#FFF 0%, #FFF 1000%"
} else {
"#DA539C 0%, #E2017B 33%, #5F0938 100%"
},
)
>
{children()}
</a>
}
}

#[component]
pub fn SecondaryHighlightedLinkButton(
children: Children,
href: String,
#[prop(optional)] classes: String,
#[prop(optional)] alt_style: Signal<bool>,
) -> impl IntoView {
view! {
<a
href=href
class=move || format!(
"rounded-full border border-white text-sm font-bold font-kumbh px-5 py-2 {} {}",
if alt_style.get() {
"bg-transparent text-white hover:bg-white/10 active:bg-white/5"
} else {
"bg-white text-black"
},
classes,
)
>
{children()}
</a>
}
}

#[component]
pub fn SecondaryHighlightedButton(
children: Children,
disabled: Signal<bool>,
alt_style: Signal<bool>,
classes: String,
on_click: impl Fn() + 'static,
) -> impl IntoView {
let on_click = move |_| on_click();
view! {
<button
disabled=move || disabled.get()
on:click=on_click
class=move ||format!(
"rounded-full border border-white text-sm font-bold font-kumbh px-5 py-2 {} {}",
if alt_style.get() {
"bg-transparent text-white hover:bg-white/10 active:bg-white/5"
} else {
"bg-white text-black"
},
classes,
)
>

{children()}
</button>
}
}
23 changes: 7 additions & 16 deletions ssr/src/component/icons/airdrop_icon.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
use leptos::*;
use crate::utils::icon::icon_gen;

#[component]
pub fn AirdropIcon(
#[prop(optional, default = "w-full h-full".to_string())] classes: String,
) -> impl IntoView {
view! {
<svg
class=format!("{}", classes)
viewBox="0 0 30 30"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<mask
icon_gen!(
AirdropIcon,
view_box = "0 0 30 30",
r###"<mask
id="mask0_694_2577"
style="mask-type:alpha"
maskUnits="userSpaceOnUse"
Expand Down Expand Up @@ -40,7 +33,5 @@ pub fn AirdropIcon(
fill="currentColor"
/>
</g>
</g>
</svg>
}
}
</g>"###
);
23 changes: 7 additions & 16 deletions ssr/src/component/icons/arrow_left_right_icon.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
use leptos::*;
use crate::utils::icon::icon_gen;

#[component]
pub fn ArrowLeftRightIcon(
#[prop(optional, default = "w-full h-full".to_string())] classes: String,
) -> impl IntoView {
view! {
<svg
class=format!("{}", classes)
viewBox="0 0 31 30"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<mask
icon_gen!(
ArrowLeftRightIcon,
view_box = "0 0 31 30",
r###"<mask
id="mask0_500_15031"
style="mask-type:alpha"
maskUnits="userSpaceOnUse"
Expand All @@ -27,7 +20,5 @@ pub fn ArrowLeftRightIcon(
d="M10.9024 22.3831C10.6176 22.6398 10.1854 22.6413 9.8988 22.3866L6.27834 19.1684C5.83082 18.7706 5.83082 18.0714 6.27834 17.6736L9.89869 14.4555C10.1853 14.2007 10.6177 14.2023 10.9024 14.4591C11.2354 14.7593 11.2335 15.2824 10.8984 15.5802L8.50245 17.7098H17.8106C18.2034 17.7098 18.5218 18.0282 18.5218 18.421C18.5218 18.8138 18.2034 19.1322 17.8106 19.1322H8.50245L10.8984 21.262C11.2336 21.5599 11.2354 22.0829 10.9024 22.3831ZM21.6013 16.9979C21.3147 17.2527 20.8823 17.2511 20.5975 16.9943C20.2646 16.6941 20.2664 16.1711 20.6015 15.8732L22.9976 13.7434H13.6893C13.2966 13.7434 12.9782 13.425 12.9782 13.0323C12.9782 12.6396 13.2966 12.3212 13.6893 12.3212H22.9976L20.6016 10.1914C20.2664 9.89355 20.2646 9.37054 20.5975 9.07027C20.8823 8.81346 21.3147 8.81192 21.6013 9.06669L25.2217 12.2848C25.6692 12.6826 25.6692 13.3818 25.2217 13.7796L21.6013 16.9979Z"
fill="currentColor"
/>
</g>
</svg>
}
}
</g>"###
);
23 changes: 7 additions & 16 deletions ssr/src/component/icons/chevron_right_icon.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
use leptos::*;
use crate::utils::icon::icon_gen;

#[component]
pub fn ChevronRightIcon(
#[prop(optional, default = "w-full h-full".to_string())] classes: String,
) -> impl IntoView {
view! {
<svg
class=format!("{}", classes)
viewBox="0 0 30 30"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
icon_gen!(
ChevronRightIcon,
view_box = "0 0 30 30",
r###"<path
d="M12.1224 24.0156C11.7522 24.3858 11.1518 24.3858 10.7815 24.0156V24.0156C10.4113 23.6453 10.4113 23.0449 10.7815 22.6746L17.891 15.5652L10.7815 8.45569C10.4113 8.08541 10.4113 7.48507 10.7815 7.11479V7.11479C11.1518 6.74451 11.7522 6.74451 12.1224 7.11479L19.8657 14.8581C20.2562 15.2486 20.2562 15.8818 19.8657 16.2723L12.1224 24.0156Z"
fill="currentColor"
/>
</svg>
}
}
/>"###
);
24 changes: 24 additions & 0 deletions ssr/src/component/icons/eye_hide_icon.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use leptos::*;

#[component]
pub fn EyeHiddenIcon(
#[prop(optional, default = "w-full h-full".to_string())] classes: String,
) -> impl IntoView {
view! {
<svg
class=format!("{}", classes)
viewBox="0 0 37 23"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M13.83 16.4851L13.8288 16.4828L24.9494 9.17546L31.3754 4.95298L31.3743 4.95183L34.1739 3.11239C34.3262 3.01147 34.4315 2.85436 34.4693 2.67661C34.5048 2.49771 34.4693 2.31193 34.3708 2.15826L33.8682 1.3922C33.7365 1.19151 33.5166 1.08257 33.2934 1.08257C33.164 1.08257 33.0311 1.11812 32.9155 1.19495L29.4117 3.49771C26.0682 1.24541 22.3456 0 18.5006 0C11.5467 0 4.93757 3.95069 0.370001 10.8383C0.115802 11.2213 0.115802 11.7144 0.370001 12.0975C2.11161 14.7236 4.15665 16.9071 6.39864 18.6216L2.82497 20.9702C2.67268 21.0711 2.56733 21.2282 2.52955 21.406C2.49405 21.5849 2.52955 21.7706 2.62802 21.9243L3.13069 22.6904C3.26237 22.8911 3.48222 23 3.70551 23C3.83489 23 3.96772 22.9644 4.08337 22.8876L8.43567 20.0275C8.43567 20.0287 8.43681 20.0287 8.43681 20.0287L13.83 16.4851ZM11.6292 11.4679C11.6292 7.67316 14.7105 4.58716 18.4994 4.58716C20.659 4.58716 22.5666 5.60436 23.8193 7.17316L12.4525 14.6433C11.9441 13.6904 11.6292 12.6227 11.6292 11.4679Z"
fill="currentColor"
/>
<path
d="M36.63 10.8383C35.5697 9.23855 34.3891 7.81538 33.1296 6.54474L25.3502 11.6583C25.2483 15.3624 22.2231 18.3486 18.4994 18.3486C17.5937 18.3486 16.7326 18.1629 15.9402 17.8429L10.7624 21.2454C13.2288 22.3463 15.8372 22.9358 18.5005 22.9358C25.4567 22.9358 32.0658 18.9851 36.63 12.0975C36.8842 11.7145 36.8842 11.2213 36.63 10.8383Z"
fill="currentColor"
/>
</svg>
}
}
1 change: 1 addition & 0 deletions ssr/src/component/icons/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ pub mod airdrop_icon;
pub mod arrow_left_right_icon;
pub mod chevron_right_icon;
pub mod notification_icon;
pub mod eye_hide_icon;
pub mod send_icon;
pub mod share_icon;
24 changes: 7 additions & 17 deletions ssr/src/component/icons/send_icon.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
use leptos::*;
use crate::utils::icon::icon_gen;

#[component]
pub fn SendIcon(
#[prop(optional, default = "w-full h-full".to_string())] classes: String,
#[prop(optional)] filled: bool,
) -> impl IntoView {
view! {
<svg
class=format!("{}", classes)
viewBox="0 0 31 30"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<mask
icon_gen!(
SendIcon,
view_box = "0 0 31 30",
r###"<mask
id="mask0_500_15024"
style="mask-type:alpha"
maskUnits="userSpaceOnUse"
Expand All @@ -30,7 +22,5 @@ pub fn SendIcon(
fill=move || format!("{} ", if filled { "currentColor" } else { "none" })
stroke-width="1.2"
/>
</g>
</svg>
}
}
</g>"###
);
23 changes: 7 additions & 16 deletions ssr/src/component/icons/share_icon.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
use leptos::*;
use crate::utils::icon::icon_gen;

#[component]
pub fn ShareIcon(
#[prop(optional, default = "w-full h-full".to_string())] classes: String,
) -> impl IntoView {
view! {
<svg
class=format!("{}", classes)
viewBox="0 0 31 30"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<mask
icon_gen!(
ShareIcon,
view_box = "0 0 31 30",
r###"<mask
id="mask0_500_15047"
style="mask-type:alpha"
maskUnits="userSpaceOnUse"
Expand Down Expand Up @@ -40,7 +33,5 @@ pub fn ShareIcon(
fill="currentColor"
/>
</g>
</g>
</svg>
}
}
</g>"###
);
1 change: 1 addition & 0 deletions ssr/src/component/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub mod auth_providers;
pub mod back_btn;
pub mod base_route;
pub mod bullet_loader;
pub mod buttons;
pub mod canisters_prov;
pub mod coming_soon;
pub mod connect;
Expand Down
3 changes: 3 additions & 0 deletions ssr/src/consts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ pub const CDAO_SWAP_TIME_SECS: u64 = CDAO_SWAP_PRE_READY_TIME_SECS + 150;
pub const ICPUMP_SEARCH_GRPC_URL: &str = "https://prod-yral-icpumpsearch.fly.dev:443";
pub const NSFW_SERVER_URL: &str = "https://prod-yral-nsfw-classification.fly.dev:443";

pub const CF_KV_ML_CACHE_NAMESPACE_ID: &str = "ea145fc839bd42f9bf2d34b950ddbda5";
pub const CLOUDFLARE_ACCOUNT_ID: &str = "a209c523d2d9646cc56227dbe6ce3ede";

pub mod social {
pub const TELEGRAM: &str = "https://t.me/+c-LTX0Cp-ENmMzI1";
pub const DISCORD: &str = "https://discord.gg/GZ9QemnZuj";
Expand Down
Loading

0 comments on commit 9a12aa2

Please sign in to comment.