Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
Linzo99 committed Mar 6, 2024
1 parent fed1c54 commit 600451e
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 2,590 deletions.
2 changes: 0 additions & 2 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { link } from "fs"

import { about } from "@/config/pages"

export default function About() {
Expand Down
4 changes: 0 additions & 4 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ export const metadata: Metadata = {
template: `%s - ${siteConfig.name}`,
},
},
themeColor: [
{ media: "(prefers-color-scheme: light)", color: "white" },
{ media: "(prefers-color-scheme: dark)", color: "black" },
],
icons: {
icon: "/icons/favicon.ico",
shortcut: ["/icons/favicon-16x16.png", "/icons/favicon-32x32.png"],
Expand Down
7 changes: 2 additions & 5 deletions components/Navbar/NavigationDrawer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"use client"

import React, { useState } from "react"
import React, { Suspense } from "react"
import Link from "next/link"

import { siteConfig } from "@/config/site"
import useRouteChanged from "@/hooks/useRouteChanged"
import { Separator } from "@/components/ui/separator"
import {
Sheet,
Expand All @@ -18,10 +17,8 @@ import CustomIcon from "@/components/icons"
import DonationCard from "./DonationCard"

const NavigationDrawer = () => {
const [open, setOpen] = useState(false)
useRouteChanged(() => setOpen(false))
return (
<Sheet open={open} onOpenChange={setOpen}>
<Sheet>
<SheetTrigger>
<CustomIcon name="Menu" size={22} className="cursor-pointer" />
</SheetTrigger>
Expand Down
7 changes: 2 additions & 5 deletions components/Navbar/SettingDrawer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"use client"

import React, { useState } from "react"
import React from "react"
import { Settings } from "lucide-react"

import useRouteChanged from "@/hooks/useRouteChanged"
import { Separator } from "@/components/ui/separator"
import {
Sheet,
Expand All @@ -18,10 +17,8 @@ import ThemeToggle from "./ThemeToggle"
import VerseSetting from "./VerseSetting"

const SettingDrawer = () => {
const [open, setOpen] = useState(false)
useRouteChanged(() => setOpen(false))
return (
<Sheet open={open} onOpenChange={setOpen}>
<Sheet>
<SheetTrigger>
<Settings className="size-5 md:size-6" />
</SheetTrigger>
Expand Down
9 changes: 1 addition & 8 deletions components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from "@supabase/auth-helpers-nextjs"
import { Github, Search } from "lucide-react"

import useRouteChanged from "@/hooks/useRouteChanged"
import useScrollDirection from "@/hooks/useScrollDirection"
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog"
import Command from "@/components/Command"
Expand All @@ -21,19 +20,13 @@ import { UserAccount } from "./UserAccount"

const Navbar = () => {
const [user, setUser] = useState<User | null>(null)
const [open, setOpen] = useState(false)
const { setVisible, visible } = useStore(navbarSelector)
const supabase = createClientComponentClient()

useEffect(() => {
supabase.auth.getUser().then(({ data }) => setUser(data.user))
}, [supabase])

useRouteChanged(() => {
setOpen(false)
setVisible(true)
})

const onDirectionChange = useCallback(
(direction: string, newYPosition: number) => {
if (newYPosition > 80 && direction === "down") setVisible(false)
Expand Down Expand Up @@ -65,7 +58,7 @@ const Navbar = () => {
>
<Github className="size-5 md:size-6" />
</a>
<Dialog open={open} onOpenChange={setOpen}>
<Dialog>
<DialogTrigger asChild>
<Search className="size-5 cursor-pointer md:size-6" />
</DialogTrigger>
Expand Down
15 changes: 0 additions & 15 deletions hooks/useRouteChanged.js

This file was deleted.

94 changes: 1 addition & 93 deletions public/sw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion public/sw.js.map

This file was deleted.

Loading

0 comments on commit 600451e

Please sign in to comment.