Skip to content

Commit

Permalink
feat: refactor general layout; topbar; add 'feedback' button
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemSBulgakov committed Oct 26, 2024
1 parent 39bf485 commit 9ded6fa
Show file tree
Hide file tree
Showing 45 changed files with 588 additions and 660 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en" class="dark">
<html lang="en" class="dark h-full overflow-hidden">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Expand Down Expand Up @@ -36,14 +36,14 @@
<script type="module" src="/src/app/entry-client.tsx"></script>
</head>

<body>
<body class="h-full overflow-hidden">
<!-- Notice in case of disabled JavaScript -->
<noscript class="flex w-full justify-center bg-red-700 p-8">
You need to enable JavaScript to run this app.
</noscript>

<!-- Main app container -->
<div id="app" class="font-primary text-lg text-text-main">
<div id="app" class="h-full font-rubik text-lg text-text-main">
<!-- Show loading state. App will replace this after rendering -->
<div class="flex h-screen w-full items-center justify-center">
<span
Expand Down
18 changes: 8 additions & 10 deletions src/app/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,16 @@ export const Route = createRootRouteWithContext<RouterContext>()({

// 404 page
notFoundComponent: () => (
<div className="flex flex-row">
<div className="flex h-full flex-row">
<Sidebar>
<main className="w-full @container/main">
<div className="flex h-[100dvh] flex-row justify-center p-4 @container/content @2xl/main:p-12">
<div className="flex flex-col justify-center text-center">
<h1 className="mb-8 text-4xl font-bold">404 / not found</h1>
<Link to="/" className="selected">
Go to main
</Link>
</div>
<div className="flex h-full flex-grow flex-col">
<div className="flex h-full flex-col justify-center text-center @container/content">
<h1 className="mb-4 text-4xl font-bold">404 / not found</h1>
<Link to="/" className="selected">
Go to dashboard
</Link>
</div>
</main>
</div>
</Sidebar>
</div>
),
Expand Down
2 changes: 1 addition & 1 deletion src/app/routes/_with_menu/account/connect-telegram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const Route = createFileRoute("/_with_menu/account/connect-telegram")({
<link rel="canonical" href="https://innohassle.ru/account" />
</Helmet>

<div className="my-4 flex w-full max-w-md flex-col gap-4 rounded-2xl bg-primary-main px-4 py-6 @container/account">
<div className="m-4 flex w-full max-w-md flex-col gap-4 rounded-2xl bg-primary-main px-4 py-6 @container/account">
<img
src="/icon.svg"
alt="InNoHassle logo"
Expand Down
9 changes: 3 additions & 6 deletions src/app/routes/_with_menu/account/route.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { NavbarTemplate } from "@/components/layout/Navbar.tsx";
import { Topbar } from "@/components/layout/Topbar.tsx";
import { createFileRoute, Outlet } from "@tanstack/react-router";

export const Route = createFileRoute("/_with_menu/account")({
component: () => (
<div className="flex flex-col p-4 @container/content @2xl/main:p-12">
<NavbarTemplate
title="My account"
description="Manage your InNoHassle Account and services."
/>
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
<Topbar title="My account" />
<Outlet />
</div>
),
Expand Down
9 changes: 3 additions & 6 deletions src/app/routes/_with_menu/dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { DashboardPage } from "@/components/dashboard/DashboardPage.tsx";
import { NavbarTemplate } from "@/components/layout/Navbar.tsx";
import { Topbar } from "@/components/layout/Topbar.tsx";
import { createFileRoute } from "@tanstack/react-router";
import { Helmet } from "react-helmet-async";

export const Route = createFileRoute("/_with_menu/dashboard")({
component: () => (
<div className="flex flex-col p-4 @container/content @2xl/main:p-12">
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
<Helmet>
<title>Dashboard</title>
<meta
Expand All @@ -14,10 +14,7 @@ export const Route = createFileRoute("/_with_menu/dashboard")({
/>
</Helmet>

<NavbarTemplate
title="Dashboard"
description="Your cozy space on this planet."
/>
<Topbar title="Dashboard" />
<DashboardPage />
</div>
),
Expand Down
9 changes: 3 additions & 6 deletions src/app/routes/_with_menu/extension.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ExtensionPage } from "@/components/extension/ExtensionPage.tsx";
import { NavbarTemplate } from "@/components/layout/Navbar.tsx";
import { Topbar } from "@/components/layout/Topbar.tsx";
import { createFileRoute } from "@tanstack/react-router";
import { Helmet } from "react-helmet-async";

export const Route = createFileRoute("/_with_menu/extension")({
component: () => (
<div className="flex flex-col p-4 @container/content @2xl/main:p-12">
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
<Helmet>
<title>Browser extension</title>
<meta
Expand All @@ -14,10 +14,7 @@ export const Route = createFileRoute("/_with_menu/extension")({
/>
</Helmet>

<NavbarTemplate
title="Browser extension"
description="Convenient tools for Moodle, InNoHassle and other services at Innopolis University."
/>
<Topbar title="Browser extension" />
<ExtensionPage />
</div>
),
Expand Down
13 changes: 4 additions & 9 deletions src/app/routes/_with_menu/maps.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NavbarTemplate } from "@/components/layout/Navbar.tsx";
import { Topbar } from "@/components/layout/Topbar.tsx";
import { MapsPage } from "@/components/maps/MapsPage.tsx";
import { createFileRoute } from "@tanstack/react-router";
import { Helmet } from "react-helmet-async";
Expand All @@ -15,7 +15,7 @@ export const Route = createFileRoute("/_with_menu/maps")({
component: function RouteComponent() {
const { sceneId } = Route.useSearch();
return (
<div className="flex flex-col p-4 @container/content @2xl/main:p-12">
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
<Helmet>
<title>Maps</title>
<meta
Expand All @@ -24,13 +24,8 @@ export const Route = createFileRoute("/_with_menu/maps")({
/>
</Helmet>

<NavbarTemplate
title="Maps"
description="View plans of Innopolis University."
/>
<div className="mt-4 flex-grow">
<MapsPage sceneId={sceneId} />
</div>
<Topbar title="Maps" />
<MapsPage sceneId={sceneId} />
</div>
);
},
Expand Down
9 changes: 3 additions & 6 deletions src/app/routes/_with_menu/music-room.index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import { NavbarTemplate } from "@/components/layout/Navbar.tsx";
import { Topbar } from "@/components/layout/Topbar.tsx";
import { MusicRoomPage } from "@/components/music-room/MusicRoomPage.tsx";
import { createFileRoute } from "@tanstack/react-router";
import { Helmet } from "react-helmet-async";

export const Route = createFileRoute("/_with_menu/music-room/")({
component: () => (
<div className="flex flex-col p-4 @container/content @2xl/main:p-12">
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
<Helmet>
<title>Music room</title>
<meta name="description" content="Book the Music room in Innopolis." />
</Helmet>

<NavbarTemplate
title="Music room"
description="Book the Music room in Sports center freely."
/>
<Topbar title="Music room" />
<MusicRoomPage />
</div>
),
Expand Down
9 changes: 3 additions & 6 deletions src/app/routes/_with_menu/music-room.instructions.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import { NavbarTemplate } from "@/components/layout/Navbar.tsx";
import { Topbar } from "@/components/layout/Topbar.tsx";
import { MusicRoomInstructions } from "@/components/music-room/MusicRoomInstructions.tsx";
import { createFileRoute } from "@tanstack/react-router";
import { Helmet } from "react-helmet-async";

export const Route = createFileRoute("/_with_menu/music-room/instructions")({
component: () => (
<div className="flex flex-col p-4 @container/content @2xl/main:p-12">
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
<Helmet>
<title>Music room</title>
<meta name="description" content="Book the Music room in Innopolis." />
</Helmet>

<NavbarTemplate
title="Music room"
description="Book the Music room in Sports center freely."
/>
<Topbar title="Music room" />
<MusicRoomInstructions />
</div>
),
Expand Down
13 changes: 4 additions & 9 deletions src/app/routes/_with_menu/room-booking.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { NavbarTemplate } from "@/components/layout/Navbar.tsx";
import { Topbar } from "@/components/layout/Topbar.tsx";
import { RoomBookingPage } from "@/components/room-booking/RoomBookingPage.tsx";
import { createFileRoute } from "@tanstack/react-router";
import { Helmet } from "react-helmet-async";

export const Route = createFileRoute("/_with_menu/room-booking")({
component: () => (
<div className="flex h-[100dvh] flex-col p-4 @container/content @2xl/main:p-12">
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
<Helmet>
<title>Room booking</title>
<meta
Expand All @@ -14,13 +14,8 @@ export const Route = createFileRoute("/_with_menu/room-booking")({
/>
</Helmet>

<NavbarTemplate
title="Room booking"
description="Book auditoriums and meeting rooms in Innopolis University."
/>
<div className="mt-4 flex-grow overflow-hidden">
<RoomBookingPage />
</div>
<Topbar title="Room booking" />
<RoomBookingPage />
</div>
),
});
9 changes: 3 additions & 6 deletions src/app/routes/_with_menu/rooms.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { DormRoomsPage } from "@/components/dorm-rooms/DormRoomsPage.tsx";
import { NavbarTemplate } from "@/components/layout/Navbar.tsx";
import { Topbar } from "@/components/layout/Topbar.tsx";
import { createFileRoute } from "@tanstack/react-router";
import { Helmet } from "react-helmet-async";

export const Route = createFileRoute("/_with_menu/rooms")({
component: () => (
<div className="flex flex-col p-4 @container/content @2xl/main:p-12">
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
<Helmet>
<title>Dorm rooms</title>
<meta
Expand All @@ -14,10 +14,7 @@ export const Route = createFileRoute("/_with_menu/rooms")({
/>
</Helmet>

<NavbarTemplate
title="Dorm rooms"
description="Split duties in your dormitory room."
/>
<Topbar title="Dorm rooms" />
<DormRoomsPage />
</div>
),
Expand Down
6 changes: 3 additions & 3 deletions src/app/routes/_with_menu/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { createFileRoute, Outlet } from "@tanstack/react-router";

export const Route = createFileRoute("/_with_menu")({
component: () => (
<div className="flex flex-row">
<div className="flex h-full flex-row">
<Sidebar>
<main className="min-h-[100dvh] w-full @container/main">
<div className="flex h-full flex-grow flex-col">
<Outlet />
</main>
</div>
</Sidebar>
</div>
),
Expand Down
9 changes: 3 additions & 6 deletions src/app/routes/_with_menu/schedule/$category.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NavbarTemplate } from "@/components/layout/Navbar.tsx";
import { Topbar } from "@/components/layout/Topbar.tsx";
import ScheduleList from "@/components/schedule/ScheduleList.tsx";
import { getCategoryInfoBySlug } from "@/lib/events/events-view-config.ts";
import { createFileRoute, redirect } from "@tanstack/react-router";
Expand All @@ -14,16 +14,13 @@ export const Route = createFileRoute("/_with_menu/schedule/$category")({
}

return (
<div className="flex flex-col p-4 @container/content @2xl/main:p-12">
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
<Helmet>
<title>{categoryInfo.title} — Schedule</title>
<meta name="description" content={categoryInfo.shortDescription} />
</Helmet>

<NavbarTemplate
title={`Schedule — ${categoryInfo.title}`}
description={categoryInfo.shortDescription}
/>
<Topbar title={`Schedule — ${categoryInfo.title}`} />
<ScheduleList category={category} />
</div>
);
Expand Down
22 changes: 3 additions & 19 deletions src/app/routes/_with_menu/schedule/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { NavbarTemplate } from "@/components/layout/Navbar.tsx";
import { Topbar } from "@/components/layout/Topbar.tsx";
import { ScheduleMainPage } from "@/components/schedule/ScheduleMainPage.tsx";
import { createFileRoute } from "@tanstack/react-router";
import { Helmet } from "react-helmet-async";

export const Route = createFileRoute("/_with_menu/schedule/")({
component: () => (
<div className="flex flex-col p-4 @container/content @2xl/main:p-12">
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
<Helmet>
<title>Schedule</title>
<meta
Expand All @@ -16,23 +16,7 @@ export const Route = createFileRoute("/_with_menu/schedule/")({
}
/>
</Helmet>
<NavbarTemplate
title="InNoHassle ecosystem"
description={
<>
Services developed by{" "}
<a
href="https://t.me/one_zero_eight"
className="selected"
target="_blank"
rel="noopener noreferrer"
>
one-zero-eight
</a>{" "}
community for Innopolis students.
</>
}
/>
<Topbar title="Schedule" />
<ScheduleMainPage />
</div>
),
Expand Down
9 changes: 3 additions & 6 deletions src/app/routes/_with_menu/scholarship.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { NavbarTemplate } from "@/components/layout/Navbar.tsx";
import { Topbar } from "@/components/layout/Topbar.tsx";
import { ScholarshipPage } from "@/components/scholarship/ScholarshipPage.tsx";
import { createFileRoute } from "@tanstack/react-router";
import { Helmet } from "react-helmet-async";

export const Route = createFileRoute("/_with_menu/scholarship")({
component: () => (
<div className="flex flex-col p-4 @container/content @2xl/main:p-12">
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
<Helmet>
<title>Scholarship calculator</title>
<meta
Expand All @@ -17,10 +17,7 @@ export const Route = createFileRoute("/_with_menu/scholarship")({
/>
</Helmet>

<NavbarTemplate
title="Scholarship calculator"
description="Calculate your scholarship easily. Just type your marks, GPA or expected scholarship."
/>
<Topbar title="Scholarship" />
<ScholarshipPage />
</div>
),
Expand Down
11 changes: 4 additions & 7 deletions src/app/routes/_with_menu/search.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NavbarTemplate } from "@/components/layout/Navbar.tsx";
import { Topbar } from "@/components/layout/Topbar.tsx";
import { SearchPage } from "@/components/search/SearchPage.tsx";
import { createFileRoute } from "@tanstack/react-router";
import { Suspense } from "react";
Expand All @@ -20,19 +20,16 @@ export const Route = createFileRoute("/_with_menu/search")({
const { q } = Route.useSearch();
return (
<Suspense>
<div className="flex min-h-[100dvh] flex-col p-4 @container/content @2xl/main:p-12">
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
<Helmet>
<title>Search</title>
<meta
name="description"
content="Search for anything at Innopolis University."
content="Search anything at Innopolis University."
/>
</Helmet>

<NavbarTemplate
title="Search"
description="Find anything at Innopolis University"
/>
<Topbar title="Search" />
<SearchPage searchQuery={q} />
</div>
</Suspense>
Expand Down
Loading

0 comments on commit 9ded6fa

Please sign in to comment.