Skip to content

Commit

Permalink
set explore page on '/' update routes (#183)
Browse files Browse the repository at this point in the history
* set explore page on '/' update routes

* Update one last route and move cta cards outside conditional, closes #181
  • Loading branch information
ail3ngrimaldi authored Nov 29, 2024
1 parent e3c2118 commit 570f5d1
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 124 deletions.
2 changes: 1 addition & 1 deletion src/components/molecules/sidebar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub fn Sidebar() -> Element {
on_click: move |_| {
tooltip.hide();
is_active.set(false);
nav.push(vec![], "/explore");
nav.push(vec![], "/dashboard");
}
}
span { class: "sidebar__action-label__not-displayed",
Expand Down
138 changes: 69 additions & 69 deletions src/pages/dashboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,79 +229,79 @@ pub fn Dashboard() -> Element {
}
}
}
section { class: "card card--reverse",
div { class: "card__container",
div { class: "card__head",
h3 { class: "card__title",
{ translate!(i18,
"dashboard.cta_cards.explore.title") }
}
}
p { class: "card__description",
{
translate!(i18, "dashboard.cta_cards.explore.description") }
}
}
div { class: "card__cta",
IconButton {
class: "button--avatar",
body: rsx!(Icon { icon : Compass, height : 32, width : 32, fill : "var(--fill-00)" }),
on_click: move |_| {
nav.push(vec![], "/explore");
}
}
}
}
section { class: "card card--reverse",
div { class: "card__container",
div { class: "card__head",
h3 { class: "card__title",
{translate!(i18, "dashboard.cta_cards.create.title_part_one")},
span {
class: "animated-text",
DynamicText { words },
},
{translate!(i18, "dashboard.cta_cards.create.title_part_two")}
},
}
p { class: "card__description",
{ translate!(i18,
"dashboard.cta_cards.create.description") }
}
div { class: "card__head",
a { class: "card__learn",
{ translate!(i18, "dashboard.cta_cards.create.cta") }
}
Icon {
icon: ArrowRight,
height: 20,
width: 20,
stroke_width: 1,
fill: "var(--text-tertiary)"
}
}
}
}
section { class: "card card--reverse",
div { class: "card__container",
div { class: "card__head",
h3 { class: "card__title",
{ translate!(i18,
"dashboard.cta_cards.explore.title") }
}
}
p { class: "card__description",
{
translate!(i18, "dashboard.cta_cards.explore.description") }
}
}
div { class: "card__cta",
IconButton {
class: "button--avatar",
body: rsx!(Icon { icon : Compass, height : 32, width : 32, fill : "var(--fill-00)" }),
on_click: move |_| {
nav.push(vec![], "/");
}
}
}
}
section { class: "card card--reverse",
div { class: "card__container",
div { class: "card__head",
h3 { class: "card__title",
{translate!(i18, "dashboard.cta_cards.create.title_part_one")},
span {
class: "animated-text",
DynamicText { words },
},
{translate!(i18, "dashboard.cta_cards.create.title_part_two")}
},
}
p { class: "card__description",
{ translate!(i18,
"dashboard.cta_cards.create.description") }
}
div { class: "card__head",
a { class: "card__learn",
{ translate!(i18, "dashboard.cta_cards.create.cta") }
}
div { class: "card__cta",
IconButton {
class: "button--avatar",
size: ElementSize::Big,
body: rsx!(
Icon { icon : AddPlus, height : 32, width : 32, stroke_width : 1.5, fill :
"var(--fill-00)" }
),
on_click: move |_| {
tooltip.hide();
nav.push(
vec![
Box::new(is_chain_available(i18, timestamp, notification)),
Box::new(is_dao_owner(i18, accounts, notification)),
],
"/onboarding",
);
}
}
Icon {
icon: ArrowRight,
height: 20,
width: 20,
stroke_width: 1,
fill: "var(--text-tertiary)"
}
}
}
div { class: "card__cta",
IconButton {
class: "button--avatar",
size: ElementSize::Big,
body: rsx!(
Icon { icon : AddPlus, height : 32, width : 32, stroke_width : 1.5, fill :
"var(--fill-00)" }
),
on_click: move |_| {
tooltip.hide();
nav.push(
vec![
Box::new(is_chain_available(i18, timestamp, notification)),
Box::new(is_dao_owner(i18, accounts, notification)),
],
"/onboarding",
);
}
}
}
}
Expand Down
98 changes: 49 additions & 49 deletions src/pages/explore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,60 +206,60 @@ pub fn Explore() -> Element {
}
}
}
section { class: "card card--reverse",
div { class: "card__container",
div { class: "card__head",
h3 { class: "card__title",
{translate!(i18, "dashboard.cta_cards.create.title_part_one")}
span {
class: "animated-text",
DynamicText { words: words },
}
{translate!(i18, "dashboard.cta_cards.create.title_part_two")}
}
}
p { class: "card__description",
{ translate!(i18,
"dashboard.cta_cards.create.description") }
}
div { class: "card__head",
a { class: "card__learn",
{ translate!(i18, "dashboard.cta_cards.create.cta") }
}
Icon {
icon: ArrowRight,
height: 20,
width: 20,
stroke_width: 1,
fill: "var(--text-tertiary)"
}
}
}
div { class: "card__cta",
IconButton {
class: "button--avatar",
size: ElementSize::Big,
body: rsx!(
Icon { icon : AddPlus, height : 32, width : 32, stroke_width : 1.5, fill :
"var(--fill-00)" }
),
on_click: move |_| {
tooltip.hide();
nav.push(
vec![
Box::new(is_chain_available(i18, timestamp, notification)),
Box::new(is_dao_owner(i18, accounts, notification)),
],
"/onboarding",
);
}
}
}
}
}
}
section { class: "card card--reverse",
div { class: "card__container",
div { class: "card__head",
h3 { class: "card__title",
{translate!(i18, "dashboard.cta_cards.create.title_part_one")}
span {
class: "animated-text",
DynamicText { words: words },
}
{translate!(i18, "dashboard.cta_cards.create.title_part_two")}
}
}
p { class: "card__description",
{ translate!(i18,
"dashboard.cta_cards.create.description") }
}
div { class: "card__head",
a { class: "card__learn",
{ translate!(i18, "dashboard.cta_cards.create.cta") }
}
Icon {
icon: ArrowRight,
height: 20,
width: 20,
stroke_width: 1,
fill: "var(--text-tertiary)"
}
}
}
div { class: "card__cta",
IconButton {
class: "button--avatar",
size: ElementSize::Big,
body: rsx!(
Icon { icon : AddPlus, height : 32, width : 32, stroke_width : 1.5, fill :
"var(--fill-00)" }
),
on_click: move |_| {
tooltip.hide();
nav.push(
vec![
Box::new(is_chain_available(i18, timestamp, notification)),
Box::new(is_dao_owner(i18, accounts, notification)),
],
"/onboarding",
);
}
}
}
}
}
div { class: "dashboard__footer grid-footer",
Paginator {
from: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/onboarding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub fn Onboarding() -> Element {
use_drop(move || attach.reset());
use_coroutine(move |_: UnboundedReceiver<()>| async move {
if accounts.is_active_account_an_admin() {
nav.push(vec![], "/");
nav.push(vec![], "/dashboard");
};

if is_chain_available(i18, timestamp, notification)().is_err() {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub enum Route {
#[route("/login")]
Login {},
#[layout(Authenticated)]
#[route("/")]
#[route("/dashboard")]
Dashboard {},
#[route("/account")]
Account {},
Expand All @@ -26,7 +26,7 @@ pub enum Route {
#[route("/vos")]
VOSIntro {},
#[layout(Onboard)]
#[route("/explore")]
#[route("/")]
Explore {},
#[nest("/dao")]
#[nest("/:id")]
Expand Down
4 changes: 2 additions & 2 deletions src/pages/vos_intro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub fn VOSIntro() -> Element {
size: ElementSize::Medium,
status: None,
on_click: move |_| {
nav.push(vec![], "/explore");
nav.push(vec![], "/");
},
}
} else {
Expand All @@ -147,7 +147,7 @@ pub fn VOSIntro() -> Element {
variant: Variant::Tertiary,
status: None,
on_click: move |_| {
nav.push(vec![], "/explore");
nav.push(vec![], "/");
},
}
}
Expand Down

0 comments on commit 570f5d1

Please sign in to comment.