Skip to content

Commit

Permalink
chore: restructure components (closes #95)
Browse files Browse the repository at this point in the history
  • Loading branch information
danmaninc committed Jan 28, 2024
1 parent 90d4501 commit df0465d
Show file tree
Hide file tree
Showing 38 changed files with 43 additions and 44 deletions.
2 changes: 1 addition & 1 deletion app/@modal/(.)account/sign-in/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import SignInButton from "@/components/SignInButton";
import SignInButton from "@/components/common/SignInButton";
import {
FloatingFocusManager,
FloatingOverlay,
Expand Down
4 changes: 2 additions & 2 deletions app/@modal/(.)schedule/event-groups/[alias]/export/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import Calendar from "@/components/Calendar";
import ScheduleLinkCopy from "@/components/ScheduleLinkCopy";
import Calendar from "@/components/common/calendar/Calendar";
import ScheduleLinkCopy from "@/components/schedule/ScheduleLinkCopy";
import {
getICSLink,
useEventGroupsFindEventGroupByAlias,
Expand Down
6 changes: 3 additions & 3 deletions app/@modal/(.)schedule/event-groups/[alias]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import Calendar from "@/components/Calendar";
import ExportButton from "@/components/ExportButton";
import FavoriteButton from "@/components/FavoriteButton";
import Calendar from "@/components/common/calendar/Calendar";
import ExportButton from "@/components/schedule/ExportButton";
import FavoriteButton from "@/components/schedule/group-card/FavoriteButton";
import {
getICSLink,
useEventGroupsFindEventGroupByAlias,
Expand Down
6 changes: 3 additions & 3 deletions app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import Calendar from "@/components/Calendar";
import { GroupCard } from "@/components/GroupCard";
import SignInButton from "@/components/SignInButton";
import Calendar from "@/components/common/calendar/Calendar";
import { GroupCard } from "@/components/schedule/group-card/GroupCard";
import SignInButton from "@/components/common/SignInButton";
import {
getICSLink,
UserXFavoriteGroupView,
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/template.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NavbarTemplate } from "@/components/Navbar";
import { NavbarTemplate } from "@/components/layout/Navbar";

export default function Template({ children }: React.PropsWithChildren) {
return (
Expand Down
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Providers from "@/app/providers";
import ThemedHtml from "@/app/theme";
import Sidebar from "@/components/Sidebar";
import Sidebar from "@/components/layout/Sidebar";
import GoogleAnalytics from "@/lib/tracking/GoogleAnalytics";
import UserInfoTracker from "@/lib/tracking/UserInfoTracker";
import YandexMetrika from "@/lib/tracking/YandexMetrika";
Expand Down
4 changes: 2 additions & 2 deletions app/schedule/[category]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NavbarTemplate } from "@/components/Navbar";
import ScheduleList from "@/components/ScheduleList";
import { NavbarTemplate } from "@/components/layout/Navbar";
import ScheduleList from "@/components/schedule/ScheduleList";
import { getCategoryInfoBySlug, viewConfig } from "@/lib/events-view-config";
import { Metadata, ResolvingMetadata } from "next";
import { notFound } from "next/navigation";
Expand Down
8 changes: 4 additions & 4 deletions app/schedule/event-groups/[alias]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import Calendar from "@/components/Calendar";
import ExportButton from "@/components/ExportButton";
import FavoriteButton from "@/components/FavoriteButton";
import { NavbarTemplate } from "@/components/Navbar";
import Calendar from "@/components/common/calendar/Calendar";
import ExportButton from "@/components/schedule/ExportButton";
import FavoriteButton from "@/components/schedule/group-card/FavoriteButton";
import { NavbarTemplate } from "@/components/layout/Navbar";
import {
getICSLink,
useEventGroupsFindEventGroupByAlias,
Expand Down
8 changes: 4 additions & 4 deletions app/schedule/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import CategoryContainer from "@/components/CategoryContainer";
import ClarificationContainer from "@/components/ClarificationContainer";
import { DashboardButton } from "@/components/DashboardButton";
import { NavbarTemplate } from "@/components/Navbar";
import CategoryContainer from "@/components/schedule/CategoryContainer";
import ClarificationContainer from "@/components/schedule/ClarificationContainer";
import { DashboardButton } from "@/components/schedule/DashboardButton";
import { NavbarTemplate } from "@/components/layout/Navbar";

export default function Page() {
return (
Expand Down
4 changes: 2 additions & 2 deletions app/scholarship/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ScholarshipBmin } from "@/components/icons/ScholarshipBmin";
import { ScholarshipFormula } from "@/components/icons/ScholarshipFormula";
import { ScholarshipGPA } from "@/components/icons/ScholarshipGPA";
import { ScholarshipS } from "@/components/icons/ScholarshipS";
import { NavbarTemplate } from "@/components/Navbar";
import ScholarshipCalculator from "@/components/ScholarshipCalculator";
import { NavbarTemplate } from "@/components/layout/Navbar";
import ScholarshipCalculator from "@/components/scholarship/ScholarshipCalculator";

export default function Page() {
return (
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import CalendarEventPopover from "@/components/CalendarEventPopover";
import CalendarEventPopover from "@/components/common/calendar/CalendarEventPopover";
import { EventApi, EventContentArg } from "@fullcalendar/core";
import dayGridPlugin from "@fullcalendar/daygrid";
import interactionPlugin from "@fullcalendar/interaction";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions components/Navbar.tsx → components/layout/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SidebarMenuButton } from "@/components/Sidebar";
import SwitchThemeButton from "@/components/SwitchThemeButton";
import UserMenu from "@/components/UserMenu";
import { SidebarMenuButton } from "@/components/layout/Sidebar";
import SwitchThemeButton from "@/components/layout/SwitchThemeButton";
import UserMenu from "@/components/layout/UserMenu";
import clsx from "clsx";

export function Navbar({
Expand Down
6 changes: 3 additions & 3 deletions components/Sidebar.tsx → components/layout/Sidebar.tsx
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use client";
import SwitchThemeButton from "@/components/SwitchThemeButton";
import UserMenu from "@/components/UserMenu";
import SwitchThemeButton from "@/components/layout/SwitchThemeButton";
import UserMenu from "@/components/layout/UserMenu";
import { useUsersGetMe } from "@/lib/events";
import clsx from "clsx";
import Link from "next/link";
import { usePathname } from "next/navigation";
import React, { useState } from "react";
import { useMediaQuery } from "usehooks-ts";
import Logo from "./icons/Logo";
import Logo from "../icons/Logo";
import SidebarSection from "./SidebarSection";

type Item = {
Expand Down
2 changes: 1 addition & 1 deletion components/SidebarSection.tsx → components/layout/SidebarSection.tsx
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Tooltip from "@/components/Tooltip";
import Tooltip from "@/components/common/Tooltip";
import clsx from "clsx";
import Link from "next/link";

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions components/UserMenu.tsx → components/layout/UserMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import { SidebarContext } from "@/components/Sidebar";
import { SignInButtonIcon } from "@/components/SignInButton";
import { SidebarContext } from "@/components/layout/Sidebar";
import { SignInButtonIcon } from "@/components/common/SignInButton";
import { useAuthPaths } from "@/lib/auth";
import { useUsersGetMe } from "@/lib/events";
import {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CategoryCard from "@/components/CategoryCard";
import CategoryCard from "@/components/schedule/CategoryCard";
import { viewConfig } from "@/lib/events-view-config";

const categoriesIcons: {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ClarificationCard from "@/components/ClarificationCard";
import ClarificationCard from "@/components/schedule/ClarificationCard";
import Arrow from "@/components/icons/Arrow";

export default function ClarificationContainer() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import SignInButton from "@/components/SignInButton";
import SignInButton from "@/components/common/SignInButton";
import { useUsersGetMe } from "@/lib/events";
import Link from "next/link";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Tooltip from "@/components/Tooltip";
import Tooltip from "@/components/common/Tooltip";
import Link from "next/link";

export default function ExportButton({ alias }: { alias: string }) {
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions components/ScheduleList.tsx → components/schedule/ScheduleList.tsx
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import { GroupCard } from "@/components/GroupCard";
import SearchBar from "@/components/SearchBar";
import { GroupCard } from "@/components/schedule/group-card/GroupCard";
import SearchBar from "@/components/schedule/SearchBar";
import { getFirstTagByType } from "@/lib/event-group";
import { useEventGroupsListEventGroups, ViewEventGroup } from "@/lib/events";
import { getCategoryInfoBySlug } from "@/lib/events-view-config";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Tooltip from "@/components/Tooltip";
import Tooltip from "@/components/common/Tooltip";
import { useEventGroup } from "@/lib/event-group";
import { useUsersGetMe } from "@/lib/events";
import { useRouter } from "next/navigation";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import FavoriteButton from "@/components/FavoriteButton";
import HideButton from "@/components/HideButton";
import FavoriteButton from "@/components/schedule/group-card/FavoriteButton";
import HideButton from "@/components/schedule/group-card/HideButton";
import {
getAllTagsByType,
getFirstTagByType,
useEventGroup,
} from "@/lib/event-group";
import { ViewEventGroup } from "@/lib/events";
import { viewConfig } from "@/lib/events-view-config";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Tooltip from "@/components/Tooltip";
import Tooltip from "@/components/common/Tooltip";
import {useEventGroup} from "@/lib/event-group";

export default function HideButton({ groupId }: { groupId: number }) {
Expand Down
File renamed without changes.

0 comments on commit df0465d

Please sign in to comment.