diff --git a/src/app/[locale]/report/[id]/page.tsx b/src/app/[locale]/report/[id]/page.tsx index 59ccc55..ca97f3b 100644 --- a/src/app/[locale]/report/[id]/page.tsx +++ b/src/app/[locale]/report/[id]/page.tsx @@ -1,6 +1,5 @@ import "./ReportDetails.scss"; import { IReport } from "@/shared/types/report-type"; - import ReviewSection from "@/widgets/ReviewSection/ReviewSection"; import { Metadata } from "next"; import ReportInformation from "@/widgets/report-details/ReportInformation/ReportInformation"; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index ee3e5f7..568d357 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,4 +1,3 @@ -<<<<<<< HEAD import { ReactNode } from "react"; type Props = { @@ -7,40 +6,4 @@ type Props = { export default function RootLayout({ children }: Props) { return children; -======= -import type { Metadata } from "next"; -import "./globals.scss"; -import "./App.scss"; -// import "@/shared/fonts/fonts.scss"; -import { Providers } from "./Providers"; -import Navbar from "@/widgets/Navbar/Navbar"; -import Footer from "@/widgets/Footer/Footer"; -import { GoogleAnalytics } from '@next/third-parties/google' - - -export default function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { - return ( - - - - - - -
{children}
-
- - - - {/* - - Disable google analytics in uat - - */} - - ); ->>>>>>> d1440f3907ca91b29db2977f043e44f54993aeb1 } diff --git a/src/app/report/[id]/page.tsx b/src/app/report/[id]/page.tsx deleted file mode 100644 index eb61e3d..0000000 --- a/src/app/report/[id]/page.tsx +++ /dev/null @@ -1,138 +0,0 @@ -import "./ReportDetails.scss"; -import Image from "next/image"; -import RoadType from "@/entities/RoadType/RoadType"; -import ReportLike from "@/features/ReportLike/ReportLike"; -import { apiInstance } from "@/shared/config/apiConfig"; -import { IReport } from "@/shared/types/report-type"; -import { - ROAD_TYPES, - ROAD_TYPES_COLORS, -} from "@/shared/variables/road-types"; -import calendar from "./icons/calendar.svg"; -import map_pin from "./icons/map-pin.svg"; -import def_image from "./icons/def_image.svg"; -import ReviewSection from "@/widgets/ReviewSection/ReviewSection"; -import { Metadata } from "next"; - -export const metadata: Metadata = { - title: "KG ROAD | Обращение", - description: - "Страница обращения KG ROAD", -}; - -const ReportDetails = async ({ - params, -}: { - params: { id: string }; -}) => { - const getReportDetails = async () => { - const res = await fetch( - `${process.env.NEXT_PUBLIC_BASE_API}/report/${params.id}/`, - { cache: "no-store" } - ); - - return res.json(); - }; - const report: IReport = await getReportDetails(); - - const months: Record = { - "01": "Январь", - "02": "Февраль", - "03": "Март", - "04": "Апрель", - "05": "Май", - "06": "Июнь", - "07": "Июль", - "08": "Август", - "09": "Сентябрь", - "10": "Октябрь", - "11": "Ноябрь", - "12": "Декабрь", - }; - - const showImages = () => { - const images = []; - - for (let i = 0; i < 5; i++) { - if (report.image[i]) { - const image = ( - Report Image - ); - images.push(image); - } else { - const defImage = ( -
- Default Image -
- ); - images.push(defImage); - } - } - - return images; - }; - - return ( -
-
-
- - {ROAD_TYPES[report.category]} - -

{report.location[0].address}

-
-
- Calendar Icon -

- {months[report.created_at.slice(5, 7)]}{" "} - {report.created_at.slice(5, 7).slice(0, 1) === "0" - ? report.created_at.slice(6, 7) - : report.created_at.slice(5, 7)} - , {report.created_at.slice(0, 4)} -

-
- -
- -

- {report.description} -

- -

- Автор обращения:{" "} - - {report.author.first_name}{" "} - {report.author.last_name.slice(0, 1)}. - -

- -
-
- {showImages().map((image) => image)} -
-
- - -
- ); -}; - -export default ReportDetails; diff --git a/src/features/GoogleButton/GoogleButton.tsx b/src/features/GoogleButton/GoogleButton.tsx index af9d1dd..b24dfbb 100644 --- a/src/features/GoogleButton/GoogleButton.tsx +++ b/src/features/GoogleButton/GoogleButton.tsx @@ -4,10 +4,9 @@ import Image from "next/image"; import "./GoogleButton.scss"; import google from "./icons/google.svg"; import { useSearchParams } from "next/navigation"; -import { signIn, useSession } from "next-auth/react"; +import { signIn } from "next-auth/react"; const GoogleButton = () => { - const session = useSession(); const searchParams = useSearchParams(); const callbackUrl = searchParams.get("callbackUrl") || "/profile/personal"; diff --git a/src/shared/config/authConfig.ts b/src/shared/config/authConfig.ts index c84a1a6..28d8638 100644 --- a/src/shared/config/authConfig.ts +++ b/src/shared/config/authConfig.ts @@ -25,7 +25,6 @@ const refreshToken = async (token: JWT): Promise => { // const date = new Date().toLocaleTimeString(); // const expire = new Date(token.expires_in).toLocaleTimeString(); -<<<<<<< HEAD const verify = await verifyToken(token.access_token); if (verify) @@ -35,10 +34,6 @@ const refreshToken = async (token: JWT): Promise => { const response = await apiInstance.post( "/users/refresh/", -======= - const response = await axios.post( - "https://api.kgroad.org/api/v1/token/refresh/", ->>>>>>> d1440f3907ca91b29db2977f043e44f54993aeb1 data ); @@ -71,23 +66,7 @@ export const authConfig: AuthOptions = { password, }; -<<<<<<< HEAD const res = await apiInstance.post("/users/login/", data); -======= - const res = await fetch( - "https://api.kgroad.org/api/v1/users/login/", - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - email, - password, - }), - } - ); ->>>>>>> d1440f3907ca91b29db2977f043e44f54993aeb1 if (![200, 201].includes(res.status)) { return null; diff --git a/src/widgets/Footer/Footer.tsx b/src/widgets/Footer/Footer.tsx index ce82c6a..e4ffb8e 100644 --- a/src/widgets/Footer/Footer.tsx +++ b/src/widgets/Footer/Footer.tsx @@ -48,7 +48,7 @@ const Footer = () => {

Photo By ThomasG, CC BY-SA 3.0

- {/* +

{t("download_our_app")}

@@ -59,7 +59,6 @@ const Footer = () => { ))}
- */}
); }; diff --git a/src/widgets/forms/SignInForm/SignInForm.tsx b/src/widgets/forms/SignInForm/SignInForm.tsx index c7f213c..71a84a2 100644 --- a/src/widgets/forms/SignInForm/SignInForm.tsx +++ b/src/widgets/forms/SignInForm/SignInForm.tsx @@ -88,9 +88,7 @@ const SignInForm = () => { {loader ? : "Войти"} - {/* - */} ); diff --git a/src/widgets/home/Header/Header.tsx b/src/widgets/home/Header/Header.tsx index 525a758..d213dc0 100644 --- a/src/widgets/home/Header/Header.tsx +++ b/src/widgets/home/Header/Header.tsx @@ -14,17 +14,8 @@ const Header = () => { alt="Background Image" />
-<<<<<<< HEAD:src/widgets/home/Header/Header.tsx

{t("title")}

{t("subtitle")}

-======= -

- Дороги Кыргызстана -

-

- Сделаем дороги безопасными! Актуальная информация о состоянии дорог. -

->>>>>>> d1440f3907ca91b29db2977f043e44f54993aeb1:src/widgets/Header/Header.tsx