Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 0 additions & 152 deletions app/about/page.tsx

This file was deleted.

47 changes: 47 additions & 0 deletions app/categories/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"use client";

import { Grid2, useMediaQuery, useTheme } from "@mui/material";
import { CreateCategoryButton, CategoriesList } from "@/components/categories";
import { SearchInput } from "@/components/inputs";
import { MainLayout } from "@/components/MainLayout";
import { FiltersModal } from "@/components/modals";
import { CATEGORY_TYPE } from "@/types";
import { useGetLabels } from "@/api";

const Categories = () => {
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
useGetLabels({ labelType: CATEGORY_TYPE });

return (
<MainLayout title="Categories">
<Grid2
container
justifyContent="space-between"
direction={{ xs: "column-reverse", sm: "row" }}
alignItems="center"
gap={2}
flexWrap="nowrap"
>
<CreateCategoryButton fullWidth={isMobile} />

<Grid2
container
alignItems="center"
gap={2}
ml={{ xs: 0, sm: "auto" }}
flexWrap="nowrap"
width={{ xs: "100%", sm: "auto" }}
>
<SearchInput />

<FiltersModal labelType={CATEGORY_TYPE} />
</Grid2>
</Grid2>

<CategoriesList />
</MainLayout>
);
};

export default Categories;
3 changes: 3 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import { ProgressBar } from "@/components/ProgressBar";

export const metadata: Metadata = {
title: "My Lib",
other: {
"google-site-verification": "tF4APm9Ef57vuo1EalGFhWE486sHWOmrpH1wGcZ_Cbk",
},
};

export const viewport = {
Expand Down
5 changes: 3 additions & 2 deletions app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useState } from "react";
import { Button, Form, TextInput, Link } from "@/components";
import { FieldValues } from "react-hook-form";
import { useSnackbar } from "notistack";
import { CATEGORIES_ROUTE } from "@/types";

const schema = z.object({
email: z
Expand All @@ -21,7 +22,7 @@ const Login = () => {
const [isLoading, setIsLoading] = useState(false);
const { enqueueSnackbar } = useSnackbar();
const searchParams = useSearchParams();
const callbackUrl = searchParams.get("callbackUrl") || "/";
const callbackUrl = searchParams.get("callbackUrl") || CATEGORIES_ROUTE;

const onSubmit = async (data: FieldValues) => {
setIsLoading(true);
Expand All @@ -35,7 +36,7 @@ const Login = () => {
if (res?.error) {
enqueueSnackbar(`${res?.error}`, { variant: "error" });
} else {
window.location.assign("/");
window.location.assign(CATEGORIES_ROUTE);
}
} catch (err) {
enqueueSnackbar(`${err}`, { variant: "error" });
Expand Down
Loading