diff --git a/app/about-us/page.tsx b/app/about-us/page.tsx index 7c7697c..a54c709 100644 --- a/app/about-us/page.tsx +++ b/app/about-us/page.tsx @@ -1,3 +1,7 @@ -import AboutUsPage from "@/Pages/AboutUsPage/AboutUsPage"; +import React from "react"; -export default AboutUsPage; +const page = () => { + return
page
; +}; + +export default page; diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts deleted file mode 100644 index 8db3ff8..0000000 --- a/app/api/auth/[...nextauth]/route.ts +++ /dev/null @@ -1,91 +0,0 @@ -import axios from "axios"; -import NextAuth, { NextAuthOptions } from "next-auth"; -import { JWT } from "next-auth/jwt"; -import CredentialsProvider from "next-auth/providers/credentials"; - -interface IToken { - access: string; -} - -const refreshToken = async (token: JWT): Promise => { - const data = { - refresh: token.refresh_token, - }; - - const response = await axios.post( - "https://api.kgroaduat.fishrungames.com/api/v1/token/refresh/", - data - ); - - return { - ...token, - access_token: response.data.access, - }; -}; - -export const authOptions: NextAuthOptions = { - providers: [ - CredentialsProvider({ - name: "Credentials", - credentials: { - email: { - label: "Email", - type: "text", - placeholder: "jsmith@example.com", - }, - password: { label: "Password", type: "password" }, - }, - async authorize(credentials, req) { - if (!credentials?.email || !credentials?.password) - return null; - const { email, password } = credentials as any; - - const res = await fetch( - "https://api.kgroaduat.fishrungames.com/api/v1/users/login/", - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - email, - password, - }), - } - ); - - if (res.status === 401) { - console.log(res.status); - return null; - } - - const user = await res.json(); - return user; - }, - }), - ], - pages: { - signIn: "/sign-in", - }, - session: { - strategy: "jwt", - }, - callbacks: { - async jwt({ token, user }) { - if (user) return { ...token, ...user }; - - return refreshToken(token); - }, - - async session({ token, session }) { - session.access_token = token.access_token; - session.refresh_token = token.refresh_token; - - return session; - }, - }, -}; - -const handler = NextAuth(authOptions); - -export { handler as GET, handler as POST }; diff --git a/app/create-report/page.tsx b/app/create-report/page.tsx deleted file mode 100644 index e05f648..0000000 --- a/app/create-report/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import CreateReportPage from "@/Pages/CreateReportPage/CreateReportPage"; - -export default CreateReportPage; diff --git a/app/forgot-password/page.tsx b/app/forgot-password/page.tsx deleted file mode 100644 index a54c709..0000000 --- a/app/forgot-password/page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; - -const page = () => { - return
page
; -}; - -export default page; diff --git a/app/layout.tsx b/app/layout.tsx index 31838fa..d592330 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,9 +1,3 @@ -import RootLayout from "@/App/App"; -import type { Metadata } from "next"; - -export const metadata: Metadata = { - title: "KG Road", - description: "Road in Kyrgyzstan", -}; +import RootLayout from "@/app/App"; export default RootLayout; diff --git a/app/news/[id]/page.tsx b/app/news/[id]/page.tsx deleted file mode 100644 index 35001fc..0000000 --- a/app/news/[id]/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import NewsDetailsPage from "@/Pages/NewsDetailsPage/NewsDetailsPage"; - -export default NewsDetailsPage; diff --git a/app/news/page.tsx b/app/news/page.tsx deleted file mode 100644 index 955b210..0000000 --- a/app/news/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import NewsPage from "@/Pages/NewsPage/NewsPage"; - -export default NewsPage; diff --git a/app/page.tsx b/app/page.tsx index 3095677..9d4589f 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,3 +1,3 @@ -import Homepage from "@/Pages/Homepage/Homepage"; +import Home from "@/pages/Home/Home"; -export default Homepage; +export default Home; diff --git a/app/profile/layout.tsx b/app/profile/layout.tsx deleted file mode 100644 index 7eb27f3..0000000 --- a/app/profile/layout.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import ProfileLayout from "@/Pages/profile/ProfilePage/ProfileLayout"; - -export default ProfileLayout; diff --git a/app/profile/my-reports/page.tsx b/app/profile/my-reports/page.tsx deleted file mode 100644 index 3e91dd0..0000000 --- a/app/profile/my-reports/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import MyReportsPage from "@/Pages/profile/MyReportsPage/MyReportsPage"; - -export default MyReportsPage; diff --git a/app/confirm-email/page.tsx b/app/profile/page.tsx similarity index 100% rename from app/confirm-email/page.tsx rename to app/profile/page.tsx diff --git a/app/profile/personal-data/page.tsx b/app/profile/personal-data/page.tsx deleted file mode 100644 index 9122a75..0000000 --- a/app/profile/personal-data/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import PersonalDataPage from "@/Pages/profile/PersonalDataPage/PersonalDataPage"; - -export default PersonalDataPage; diff --git a/app/report/[id]/page.tsx b/app/report/[id]/page.tsx deleted file mode 100644 index 614d113..0000000 --- a/app/report/[id]/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import ReportDetailsPage from "@/Pages/ReportDetailsPage/ReportDetailsPage"; - -export default ReportDetailsPage; diff --git a/app/sign-in/page.tsx b/app/sign-in/page.tsx index b7c9593..a54c709 100644 --- a/app/sign-in/page.tsx +++ b/app/sign-in/page.tsx @@ -1,3 +1,7 @@ -import SignInPage from "@/Pages/SignInPage/SignInPage"; +import React from "react"; -export default SignInPage; +const page = () => { + return
page
; +}; + +export default page; diff --git a/app/sign-up/page.tsx b/app/sign-up/page.tsx deleted file mode 100644 index d6447b2..0000000 --- a/app/sign-up/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import SignUpPage from "@/Pages/SignUpPage/SignUpPage"; - -export default SignUpPage; diff --git a/app/statistics/page.tsx b/app/statistics/page.tsx deleted file mode 100644 index 2ea4a18..0000000 --- a/app/statistics/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import StatisticsPage from "@/Pages/StatisticsPage/StatisticsPage"; - -export default StatisticsPage; diff --git a/app/volunteers/page.tsx b/app/volunteers/page.tsx deleted file mode 100644 index 8bc622c..0000000 --- a/app/volunteers/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import VolunteersPage from "@/Pages/VolunteersPage/VolunteersPage"; - -export default VolunteersPage; diff --git a/src/Pages/Homepage/Homepage.scss b/src/App/App.scss similarity index 83% rename from src/Pages/Homepage/Homepage.scss rename to src/App/App.scss index dba3251..dc6a91b 100644 --- a/src/Pages/Homepage/Homepage.scss +++ b/src/App/App.scss @@ -1,9 +1,9 @@ -.home { +.app { padding-top: 78px; } @media screen and (max-width: 768px) { - .home { + .app { padding-top: 72px; } } diff --git a/src/App/App.tsx b/src/App/App.tsx index 18826aa..64c0881 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -1,10 +1,8 @@ -import { Montserrat } from "next/font/google"; import "./globals.scss"; -import Navbar from "@/Widgets/general/Navbar/Navbar"; -import Footer from "@/Widgets/general/Footer/Footer"; -import { Providers } from "./Providers"; - -const montserrat = Montserrat({ subsets: ["latin"] }); +import "./fonts.scss"; +import "./App.scss"; +import Footer from "@/widgets/Footer/Footer"; +import Navbar from "@/widgets/Navbar/Navbar"; export default function RootLayout({ children, @@ -13,12 +11,10 @@ export default function RootLayout({ }>) { return ( - - - - {children} -