From 4abc1360d3f272e1f4100ce938e95cf2170730c1 Mon Sep 17 00:00:00 2001 From: YasamanKahdooei Date: Sun, 28 Apr 2024 12:17:40 +0330 Subject: [PATCH] Added part of mainPage --- app/User/MyRequest/page.tsx | 13 ++++++++ app/User/NewRequest/page.tsx | 7 ++++ app/User/News/page.tsx | 7 ++++ app/User/Polls/page.tsx | 7 ++++ app/{ => User}/RecentRequest/page.tsx | 2 -- app/User/Settings/page.tsx | 7 ++++ app/{RecentRequest => User}/layout.tsx | 2 +- app/User/page.tsx | 9 ++++++ components/RecentRequest/NearestRequests.tsx | 18 ++++++++--- components/RecentRequest/RecentRequests.tsx | 2 +- components/RecentRequest/RequestList.tsx | 4 +-- components/RecentRequest/TabRequests.tsx | 7 ++-- components/Requests/RequestCard.tsx | 34 +++++++++++++++++--- components/Requests/RequestComments.tsx | 15 +++++++++ components/Requests/RequestLike.tsx | 16 +++++++++ components/Requests/RequestProcessIcon.tsx | 13 ++++++++ components/Requests/RequestViolation.tsx | 8 +++++ constants/index.tsx | 12 +++---- package-lock.json | 12 +++++++ package.json | 1 + tailwind.config.ts | 4 ++- utils/CitizenReport.ts | 20 ++++++++++++ 22 files changed, 195 insertions(+), 25 deletions(-) create mode 100644 app/User/MyRequest/page.tsx create mode 100644 app/User/NewRequest/page.tsx create mode 100644 app/User/News/page.tsx create mode 100644 app/User/Polls/page.tsx rename app/{ => User}/RecentRequest/page.tsx (79%) create mode 100644 app/User/Settings/page.tsx rename app/{RecentRequest => User}/layout.tsx (71%) create mode 100644 app/User/page.tsx create mode 100644 components/Requests/RequestComments.tsx create mode 100644 components/Requests/RequestLike.tsx create mode 100644 components/Requests/RequestProcessIcon.tsx create mode 100644 components/Requests/RequestViolation.tsx create mode 100644 utils/CitizenReport.ts diff --git a/app/User/MyRequest/page.tsx b/app/User/MyRequest/page.tsx new file mode 100644 index 0000000..4d1061a --- /dev/null +++ b/app/User/MyRequest/page.tsx @@ -0,0 +1,13 @@ +import RequestList from "@/components/RecentRequest/RequestList"; +import React from "react"; + +export default function page() { + return ( +
+ +
+ ); +} diff --git a/app/User/NewRequest/page.tsx b/app/User/NewRequest/page.tsx new file mode 100644 index 0000000..cb2be10 --- /dev/null +++ b/app/User/NewRequest/page.tsx @@ -0,0 +1,7 @@ +import React from 'react' + +export default function page() { + return ( +
page
+ ) +} diff --git a/app/User/News/page.tsx b/app/User/News/page.tsx new file mode 100644 index 0000000..cb2be10 --- /dev/null +++ b/app/User/News/page.tsx @@ -0,0 +1,7 @@ +import React from 'react' + +export default function page() { + return ( +
page
+ ) +} diff --git a/app/User/Polls/page.tsx b/app/User/Polls/page.tsx new file mode 100644 index 0000000..cb2be10 --- /dev/null +++ b/app/User/Polls/page.tsx @@ -0,0 +1,7 @@ +import React from 'react' + +export default function page() { + return ( +
page
+ ) +} diff --git a/app/RecentRequest/page.tsx b/app/User/RecentRequest/page.tsx similarity index 79% rename from app/RecentRequest/page.tsx rename to app/User/RecentRequest/page.tsx index 8cb7aee..d45ef7f 100644 --- a/app/RecentRequest/page.tsx +++ b/app/User/RecentRequest/page.tsx @@ -2,9 +2,7 @@ import React from 'react' import RecentRequests from '@/components/RecentRequest/RecentRequests' function page() { return ( -
-
) } diff --git a/app/User/Settings/page.tsx b/app/User/Settings/page.tsx new file mode 100644 index 0000000..cb2be10 --- /dev/null +++ b/app/User/Settings/page.tsx @@ -0,0 +1,7 @@ +import React from 'react' + +export default function page() { + return ( +
page
+ ) +} diff --git a/app/RecentRequest/layout.tsx b/app/User/layout.tsx similarity index 71% rename from app/RecentRequest/layout.tsx rename to app/User/layout.tsx index 631b828..9d1efb1 100644 --- a/app/RecentRequest/layout.tsx +++ b/app/User/layout.tsx @@ -11,7 +11,7 @@ export default function RequestLayout({ {/* Include shared UI here e.g. a header or sidebar */} -
{children}
+
{children}
); } diff --git a/app/User/page.tsx b/app/User/page.tsx new file mode 100644 index 0000000..e5593d3 --- /dev/null +++ b/app/User/page.tsx @@ -0,0 +1,9 @@ +import React from 'react' + +function page() { + return ( +
page User
+ ) +} + +export default page \ No newline at end of file diff --git a/components/RecentRequest/NearestRequests.tsx b/components/RecentRequest/NearestRequests.tsx index b000513..4acdbec 100644 --- a/components/RecentRequest/NearestRequests.tsx +++ b/components/RecentRequest/NearestRequests.tsx @@ -1,9 +1,17 @@ -import React from 'react' +import React from "react"; +import { Button } from "../ui/button"; const NearestRequests = () => { return ( -
NearestRequests
- ) -} +
+

+ برای دسترسی به این بخش به برنامه کاربردی شهربین مراجعه کنید +

+ +
+ ); +}; -export default NearestRequests \ No newline at end of file +export default NearestRequests; diff --git a/components/RecentRequest/RecentRequests.tsx b/components/RecentRequest/RecentRequests.tsx index 2ac9daf..fb6d2e0 100644 --- a/components/RecentRequest/RecentRequests.tsx +++ b/components/RecentRequest/RecentRequests.tsx @@ -17,7 +17,7 @@ function RecentRequests() { {/* Left */} -
+
{/*
diff --git a/components/RecentRequest/RequestList.tsx b/components/RecentRequest/RequestList.tsx index 6220c57..b56bd11 100644 --- a/components/RecentRequest/RequestList.tsx +++ b/components/RecentRequest/RequestList.tsx @@ -3,9 +3,9 @@ import RequestCard from "../Requests/RequestCard"; const RequestList = () => { return ( -
+
-
+ ); }; diff --git a/components/RecentRequest/TabRequests.tsx b/components/RecentRequest/TabRequests.tsx index 8ff6f98..48f717f 100644 --- a/components/RecentRequest/TabRequests.tsx +++ b/components/RecentRequest/TabRequests.tsx @@ -1,19 +1,20 @@ import React from "react"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import RequestList from "./RequestList"; +import NearestRequests from "./NearestRequests"; export function TabRequests() { return ( - + نزدیک ترین ها همه - + -

همه همه

+
); diff --git a/components/Requests/RequestCard.tsx b/components/Requests/RequestCard.tsx index ccab216..6dbf95f 100644 --- a/components/Requests/RequestCard.tsx +++ b/components/Requests/RequestCard.tsx @@ -2,10 +2,16 @@ import Image from "next/image"; import React from "react"; import img1 from "@/assets/images/no-image.jpeg"; import RequestStatus from "./RequestStatus"; +import { MdLocationOn } from "react-icons/md"; +import RequestProcessIcon from "./RequestProcessIcon"; +import RequestViolation from "./RequestViolation"; +import RequestLike from "./RequestLike"; +import RequestComments from "./RequestComments"; + const RequestCard = () => { return (
@@ -24,13 +30,33 @@ const RequestCard = () => {
{/* 2 */} -
222
+
+
+ +

م. آزادی، بل فرخی

+
+
{/* 3 */} -
333
+
+
+ کد رهگیری: + 21221212121 +
+
+ jul 28 2024 11:20 +
+
{/* 4 */} -
444
+
+ +
+ + + +
+
); diff --git a/components/Requests/RequestComments.tsx b/components/Requests/RequestComments.tsx new file mode 100644 index 0000000..7e5ff72 --- /dev/null +++ b/components/Requests/RequestComments.tsx @@ -0,0 +1,15 @@ +import React from "react"; +import { FaRegComment } from "react-icons/fa"; + +const RequestComments = () => { + return ( + <> + + + + 0 + + ); +}; + +export default RequestComments; diff --git a/components/Requests/RequestLike.tsx b/components/Requests/RequestLike.tsx new file mode 100644 index 0000000..58d64c3 --- /dev/null +++ b/components/Requests/RequestLike.tsx @@ -0,0 +1,16 @@ +import React from "react"; +import { FiHeart } from "react-icons/fi"; +import { IoMdHeart } from "react-icons/io"; + +const RequestLike = () => { + return ( + <> + + + + 0 + + ); +}; + +export default RequestLike; diff --git a/components/Requests/RequestProcessIcon.tsx b/components/Requests/RequestProcessIcon.tsx new file mode 100644 index 0000000..ef9e660 --- /dev/null +++ b/components/Requests/RequestProcessIcon.tsx @@ -0,0 +1,13 @@ +import React from "react"; +import { CgMenuRightAlt } from "react-icons/cg"; + +const RequestProcessIcon = () => { + return ( +
+ + مشاهده روند بررسی +
+ ); +}; + +export default RequestProcessIcon; diff --git a/components/Requests/RequestViolation.tsx b/components/Requests/RequestViolation.tsx new file mode 100644 index 0000000..6b17bf8 --- /dev/null +++ b/components/Requests/RequestViolation.tsx @@ -0,0 +1,8 @@ +import React from "react"; +import { FaRegFlag } from "react-icons/fa6"; + +const RequestViolation = () => { + return ; +}; + +export default RequestViolation; diff --git a/constants/index.tsx b/constants/index.tsx index b699816..13f94df 100644 --- a/constants/index.tsx +++ b/constants/index.tsx @@ -6,11 +6,11 @@ import { TbWorld } from "react-icons/tb"; import { FaCogs } from "react-icons/fa"; export const menuItems = [ - { id: 1, title: "صفحه اصلی", href: "/RecentRequest", icon: }, - { id: 2, title: "ثبت درخواست", href: "/", icon: }, - { id: 3, title: "درخواست های من", href: "/", icon: }, - { id: 4, title: "نظرسنجی ها ", href: "/", icon: }, - { id: 5, title: "اخبار", href: "/" , icon: }, - { id: 6, title: "تنظیمات", href: "/", icon: }, + { id: 1, title: "صفحه اصلی", href: "/User/RecentRequest", icon: }, + { id: 2, title: "ثبت درخواست", href: "/User/NewRequest", icon: }, + { id: 3, title: "درخواست های من", href: "/User/MyRequest", icon: }, + { id: 4, title: "نظرسنجی ها ", href: "/User/Polls", icon: }, + { id: 5, title: "اخبار", href: "/User/News" , icon: }, + { id: 6, title: "تنظیمات", href: "/User/Settings", icon: }, ]; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index be7fedd..0152804 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,6 +34,7 @@ "react-otp-input": "^3.1.1", "sonner": "^1.4.41", "tailwind-merge": "^2.2.2", + "tailwind-scrollbar": "^3.1.0", "tailwindcss-animate": "^1.0.7", "zod": "^3.22.4", "zustand": "^4.5.2" @@ -5264,6 +5265,17 @@ "url": "https://github.com/sponsors/dcastil" } }, + "node_modules/tailwind-scrollbar": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tailwind-scrollbar/-/tailwind-scrollbar-3.1.0.tgz", + "integrity": "sha512-pmrtDIZeHyu2idTejfV59SbaJyvp1VRjYxAjZBH0jnyrPRo6HL1kD5Glz8VPagasqr6oAx6M05+Tuw429Z8jxg==", + "engines": { + "node": ">=12.13.0" + }, + "peerDependencies": { + "tailwindcss": "3.x" + } + }, "node_modules/tailwindcss": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.3.tgz", diff --git a/package.json b/package.json index b52e5bf..b06cd0b 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "react-otp-input": "^3.1.1", "sonner": "^1.4.41", "tailwind-merge": "^2.2.2", + "tailwind-scrollbar": "^3.1.0", "tailwindcss-animate": "^1.0.7", "zod": "^3.22.4", "zustand": "^4.5.2" diff --git a/tailwind.config.ts b/tailwind.config.ts index 8c39226..037f70f 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -33,6 +33,8 @@ const config = { green: "#006400", lightGreen: "#06d6a0", blue: "#003aa3", + blue2: "#3b82f6", + blue3: "#0ea5e9", bgmain: "#f5f7fa", border: "hsl(var(--border))", input: "hsl(var(--input))", @@ -89,7 +91,7 @@ const config = { }, }, }, - plugins: [require("tailwindcss-animate")], + plugins: [require("tailwindcss-animate"), require('tailwind-scrollbar')], } satisfies Config; export default config; diff --git a/utils/CitizenReport.ts b/utils/CitizenReport.ts new file mode 100644 index 0000000..ae62f31 --- /dev/null +++ b/utils/CitizenReport.ts @@ -0,0 +1,20 @@ +import axios from "axios"; +import { CookieValueTypes } from "cookies-next"; + +axios.defaults.baseURL = process.env.NEXT_PUBLIC_BASE_URL_APP; +// axios.defaults.baseURL = "https://shahrbinapi.shetabdahi.ir/"; + +// Get Captcha +export async function getLocation() { + const data = await axios.get(`/api/CitizenReport/Locations`, { + }); + return data.data; +} + +export async function resendOtp(payload: { otpToken: string | any}) { + const data = await axios.post( + `/api/Authenticate/ResendOtp`, + payload + ); + return data.data; +}