Skip to content

Commit

Permalink
chore(Frontend): 🚧 Change WIP page to Unimplement error page
Browse files Browse the repository at this point in the history
  • Loading branch information
KAIYOHUGO committed Aug 24, 2024
1 parent f10262a commit e9c1869
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 32 deletions.
4 changes: 2 additions & 2 deletions frontend/src/pages/about.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use leptos::*;

// use crate::components::*;
use crate::components::*;

#[component]
pub fn About() -> impl IntoView {
view! { <h1>About</h1> }
view! { <Unimplemented /> }
}
6 changes: 4 additions & 2 deletions frontend/src/pages/contest.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use leptos::*;

use crate::components::*;

#[component]
pub fn About() -> impl IntoView {
view! { <h1>About</h1> }
pub fn Contest() -> impl IntoView {
view! { <Unimplemented /> }
}
4 changes: 2 additions & 2 deletions frontend/src/pages/contests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use leptos::*;

// use crate::components::*;
use crate::components::*;

#[component]
pub fn Contests() -> impl IntoView {
view! { <h1>Contest</h1> }
view! { <Unimplemented /> }
}
10 changes: 1 addition & 9 deletions frontend/src/pages/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,5 @@ use crate::components::*;

#[component]
pub fn Home() -> impl IntoView {
// <Modal level=ModalLevel::Error>Test</Modal>

let toast = use_toast();
view! {
<Button on:click=move |_| toast(
ToastVariant::Error,
view! { "This is a error message............." }.into_view(),
)>Click Me</Button>
}
view! { <Unimplemented /> }
}
1 change: 1 addition & 0 deletions frontend/src/pages/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ mod problem;
mod problems;
mod rank;
mod submission;
mod contest;
pub use pages::*;
5 changes: 3 additions & 2 deletions frontend/src/pages/pages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use leptos_router::*;
use leptos_use::*;

use super::{
about::About, contests::Contests, create, home::Home, login::Login,
problem::ProblemRouter, problems::Problems, rank::Rank,
about::About, contest::Contest, contests::Contests, create, home::Home,
login::Login, problem::ProblemRouter, problems::Problems, rank::Rank,
submission::Submission,
};
use crate::{components::*, utils::*};
Expand Down Expand Up @@ -55,6 +55,7 @@ pub fn Pages() -> impl IntoView {
<Route path="/problems" view=Problems ssr=SsrMode::Async />
<Route path="/submissions" view=Submission />
<Route path="/contests" view=Contests />
<Route path="/contest" view=Contest />
<Route path="/about" view=About />
<Route path="/rank" view=Rank />
<ProblemRouter />
Expand Down
7 changes: 0 additions & 7 deletions frontend/src/pages/problem/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ pub fn ProblemContent(
) -> impl IntoView {
view! {
<div class=tw_join!("p-3 rounded h-full w-full flex flex-col", class)>
<ul class="flex flex-row space-x-4 p-4 pt-0 mb-2 border-b-2 border-accent">
<li>Problem</li>
<li>Solution</li>
<li>Discussion</li>
<li>Submission</li>
</ul>

<h1 class="text-2xl my-2">{full_info.info.title}</h1>

<div class="flex-grow relative overflow-y-auto bg-black-900">
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/pages/problem/discussion.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use leptos::*;

use crate::components::*;

#[component]
pub fn ProblemDiscussion() -> impl IntoView {
view! { <Unimplemented /> }
}
8 changes: 8 additions & 0 deletions frontend/src/pages/problem/education.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use leptos::*;

use crate::components::*;

#[component]
pub fn ProblemEducation() -> impl IntoView {
view! { <Unimplemented /> }
}
7 changes: 6 additions & 1 deletion frontend/src/pages/problem/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
mod content;
mod discussion;
mod editor;
mod education;
mod problem;

mod submission;
pub use content::ProblemContent;
pub use discussion::ProblemDiscussion;
pub use editor::ProblemEditor;
pub use education::ProblemEducation;
pub use problem::ProblemRouter;
pub use submission::ProblemSubmission;
9 changes: 6 additions & 3 deletions frontend/src/pages/problem/problem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use leptos::*;
use leptos_icons::*;
use leptos_router::*;

use super::{ProblemContent, ProblemEditor};
use super::*;
use crate::{components::*, utils::*};

#[derive(Params, PartialEq, Clone, Copy)]
Expand All @@ -14,7 +14,10 @@ struct ProblemParams {
pub fn ProblemRouter() -> impl IntoView {
view! {
<Route path="/problem/:id" view=Problem>
<Route path="" view=Content />
<Route path="" view=Content ssr=SsrMode::Async />
<Route path="/education" view=ProblemEducation ssr=SsrMode::Async />
<Route path="/discussion" view=ProblemDiscussion />
<Route path="/submission" view=ProblemSubmission />
</Route>
}
}
Expand Down Expand Up @@ -68,7 +71,7 @@ fn Problem() -> impl IntoView {
#[component]
fn VerticalNavbar() -> impl IntoView {
view! {
<ul class="grid auto-rows-min gap-y-4 p-2 my-auto bg-black-900">
<ul class="grid auto-rows-min gap-y-8 p-2 my-auto bg-black-900">
<VerticalNavbarButton icon=icondata::BsBook href="">
Problem
</VerticalNavbarButton>
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/pages/problem/submission.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use leptos::*;

use crate::components::*;

#[component]
pub fn ProblemSubmission() -> impl IntoView {
view! { <Unimplemented /> }
}
4 changes: 2 additions & 2 deletions frontend/src/pages/rank.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use leptos::*;

// use crate::components::*;
use crate::components::*;

#[component]
pub fn Rank() -> impl IntoView {
view! { <h1>Rank</h1> }
view! { <Unimplemented /> }
}
4 changes: 2 additions & 2 deletions frontend/src/pages/submission.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use leptos::*;

// use crate::components::*;
use crate::components::*;

#[component]
pub fn Submission() -> impl IntoView {
view! { <h1>Submission</h1> }
view! { <Unimplemented /> }
}

0 comments on commit e9c1869

Please sign in to comment.