diff --git a/docs/codebase-structure.md b/docs/codebase-structure.md new file mode 100644 index 00000000..ce70bdcc --- /dev/null +++ b/docs/codebase-structure.md @@ -0,0 +1,47 @@ +## Codebase Structure + +```markdown +## File Structure + +project-name/ +├── public/ +│ ├── index.html +│ ├── firebase-scripts (To load scripts locally) +│ ├── lotties (Lottie files) +│ ├── statics-images +│ ├── .well-known/ +│ │ ├── assetlinks.json (TWA config file) +│ └── ... +├── src/ +│ ├── apps/ +│ ├── components/ +│ ├── assets/ +│ ├── hooks/ +│ ├── pages/ +│ ├── routes/ +│ ├── utils/ +│ ├── App.css +│ ├── App.tsx +│ ├── main.tsx +│ └── ... +├── package.json +└── ... +``` + +## Source Structure + +- `components/`: Reusable presentational components +- `layouts/`: Components that are layout or container or wrapper of other + components +- `hooks/`: React custom hooks +- `contexts/`: React contexts providers +- `pages/`: Project pages same as created routes +- `services/`: React query and api call hooks and functions / back-end relations +- `routes/`: Main structure of project routes +- `data/`: Static data itmes +- `assets/`: Project assests like images, videos, fonts, etc. +- `utils/`: Utility functions and helpers + +--- + +[Go back to Readme](../README.md) diff --git a/docs/coding-guidelines.md b/docs/coding-guidelines.md new file mode 100644 index 00000000..2fa27980 --- /dev/null +++ b/docs/coding-guidelines.md @@ -0,0 +1,23 @@ +## Style Guide + +- Use the Airbnb JavaScript style guide. +- Prefer functional components over class components. + +## Naming Conventions + +- **Pages:** Use kebab-case (e.g., `page-test.tsx`) exactly like the route of the page +- **Files:** Use PascalCase (e.g., `task-list.tsx`) +- **Components:** Use PascalCase (e.g., `TaskList`) +- **Layouts:** Use PascalCase (e.g., `TaskList`) +- **Hooks:** Use camelCase (e.g., `taskName`) +- **Constants:** Use UPPER_SNAKE_CASE (e.g., `API_URL`) + +## Best Practices + +- Write pure functions where possible. +- Keep components small and focused on a single responsibility. +- Use TypeScript for type safety. + +--- + +[Go back to Readme](../README.md) diff --git a/docs/environment-configuration.md b/docs/environment-configuration.md new file mode 100644 index 00000000..d2dc47a4 --- /dev/null +++ b/docs/environment-configuration.md @@ -0,0 +1,18 @@ +## Environment Configuration + +Create a `.env` file in the root directory and follow the variables in [.env.example](../.env.example) + +```bash +# app back-end api services base url +VITE_APP_API_URL= +# the app website address url to load images +VITE_APP_SITE_URL= +# the digital business card back-end api services base url +VITE_CARD_API_URL= +# the pwa vapid public key +VITE_VAPID_PUBLIC_KEY= +``` + +--- + +[Go back to Readme](../README.md) diff --git a/docs/styling-guide.md b/docs/styling-guide.md new file mode 100644 index 00000000..8cbea72b --- /dev/null +++ b/docs/styling-guide.md @@ -0,0 +1,64 @@ +# Styling Guide + +## Overview + +This project uses [Shadcn ui](https://ui.shadcn.com/) and [Tailwind CSS](https://tailwindcss.com/) for styling, +integrated with the [Vite](https://vitejs.dev/) build tool. This guide explains +how to customize the theme fonts and colors in a Tailwind CSS project set up +with Vite. Tailwind CSS allows for easy theme customization through the +`tailwind.config.js` file. + +## Customizing Fonts + +### Changing Default Fonts + +To change the default fonts, modify the `fontFamily` key in the `theme` section +of `tailwind.config.js`: + +```javascript +module.exports = { + theme: { + fontFamily: { + vazirmatn: ['Vazirmatn', 'tahoma', 'sans-serif'], + nastaliq: ['IranNastaliq', 'Vazirmatn', 'tahoma', 'sans-serif'], + boblious: ['Boblious', 'Vazirmatn', 'tahoma', 'sans-serif'], + hayat: ['Hayat', 'Vazirmatn', 'tahoma', 'sans-serif'], + digiMadasi: ['DigiMadasi', 'Vazirmatn', 'tahoma', 'sans-serif'], + }, + }, + plugins: [], +}; +``` + +### Customizing Colors + +Update `tailwind.config.js` to include custom colors: + +```ts +module.exports = { + theme: { + extend: { + colors: { + primary: '....', + secondary: '....', + accent: '....', + // Add more custom colors as needed + }, + }, + }, + plugins: [], +}; +``` + +Apply the custom colors in your CSS or HTML: + +```html +
{survey.customer.title}
+{survey.customer.description}
+لیست فرم نظرسنجی خالی می باشد
+ ++ {q.title} +
+ + {q.choices && ( +{title}
= ({ img, title, checked, description, onClick,
onClick={(e) => {
e.stopPropagation();
onView && onView();
+ setShowModal(!showModal);
}}
className="flex items-center gap-[6px] px-2 ml-2 border-2 border-[#AA00FF] bg-white text-[#AA00FF] text-lg rounded-full"
type="button"
>
- لیست فرم نظرسنجی خالی می باشد
- :
}
diff --git a/src/apps/new-ui/pages/OpinionSMS/OpinionSMS.css b/src/apps/new-ui/pages/OpinionSMS/OpinionSMS.css
new file mode 100644
index 00000000..5b26b977
--- /dev/null
+++ b/src/apps/new-ui/pages/OpinionSMS/OpinionSMS.css
@@ -0,0 +1,3 @@
+.recharts-wrapper svg.recharts-surface {
+ overflow: visible !important;
+}
\ No newline at end of file
diff --git a/src/apps/new-ui/pages/OpinionSMS/index.tsx b/src/apps/new-ui/pages/OpinionSMS/index.tsx
index d50f4602..d802769e 100644
--- a/src/apps/new-ui/pages/OpinionSMS/index.tsx
+++ b/src/apps/new-ui/pages/OpinionSMS/index.tsx
@@ -1,15 +1,17 @@
-import { useEffect, useMemo, useState } from "react";
-import EmptyListIcon from "@new-ui/assets/empty-list.svg";
-import { Plus } from "lucide-react";
-import microphoneIcon from "@new-ui/assets/PurchaseSubscription/microphone.svg";
-import searchIcon from "@new-ui/assets/PurchaseSubscription/Search.svg";
-import UserCard from "./+components/UserCard";
+import { useMemo, useState } from "react";
+import { CustomerItem, FormItem, CreatedSurvey } from "./types";
+import Header from "./+components/Header";
+import SearchBar from "./+components/SearchBar";
+import GaugeCard from "./+components/GaugeCard";
+import EmptyState from "./+components/EmptyState";
+import CreatedSurveyCard from "./+components/CreatedSurveyCard";
+import CreatePanel from "./+components/CreatePanel";
+import BottomActions from "./+components/BottomActions";
import profilePicture from "@new-ui/assets/Profile pic.png";
-import arrowWhiteIcon from "@new-ui/assets/smsKade/ArrowWhite.svg";
-import arrowGrayIcon from "@new-ui/assets/smsKade/ArrowGray.svg";
-import waitingIcon from "@new-ui/assets/waiting-img.png";
+import waitingIcon from "@new-ui/assets/waiting-img.svg";
+import "./OpinionSMS.css";
-const opinionSMSListItemsTest = [
+const opinionSMSListItemsTest: CustomerItem[] = [
{ id: 1, img: profilePicture, checked: false, title: "1 پریسا آذری", description: "09121234567" },
{ id: 2, img: profilePicture, checked: false, title: "2 پریسا آذری", description: "09121234567" },
{ id: 3, img: profilePicture, checked: false, title: "پریسا آذری", description: "09121234567" },
@@ -19,7 +21,7 @@ const opinionSMSListItemsTest = [
{ id: 7, img: profilePicture, checked: false, title: "پریسا آذری", description: "09121234567" },
];
-const opinionSMSFormsListItemsTest = [
+const opinionSMSFormsListItemsTest: FormItem[] = [
{
id: 1,
img: waitingIcon,
@@ -27,273 +29,146 @@ const opinionSMSFormsListItemsTest = [
title: "فرم شماره 1",
description: "سوالات استاندارد",
questions: [
- { title: "رفتار و برخورد آرایشگر چگونه بود ؟", list: ["بسیار خوب", "خوب", "معمولی", "بد"] },
- { title: "میزان تمیزی و بهداشت وسایل چقدر بود تا خط دوم برسد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- ],
- },
- {
- id: 2,
- img: waitingIcon,
- checked: false,
- title: "فرم شماره 2",
- description: "سوالات تخصصی ترمیم",
- questions: [
- { title: "رفتار و برخورد آرایشگر چگونه بود ؟", list: ["بسیار خوب", "خوب", "معمولی", "بد"] },
- { title: "میزان تمیزی و بهداشت وسایل چقدر بود تا خط دوم برسد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- ],
- },
- {
- id: 3,
- img: waitingIcon,
- checked: false,
- title: "فرم شماره 3",
- description: "سوالات تخصصی ترمیم",
- questions: [
- { title: "رفتار و برخورد آرایشگر چگونه بود ؟", list: ["بسیار خوب", "خوب", "معمولی", "بد"] },
- { title: "میزان تمیزی و بهداشت وسایل چقدر بود تا خط دوم برسد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- ],
- },
- {
- id: 4,
- img: waitingIcon,
- checked: false,
- title: "فرم شماره 4",
- description: "سوالات تخصصی ترمیم",
- questions: [
- { title: "رفتار و برخورد آرایشگر چگونه بود ؟", list: ["بسیار خوب", "خوب", "معمولی", "بد"] },
- { title: "میزان تمیزی و بهداشت وسایل چقدر بود تا خط دوم برسد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
- { title: "آیا وقت دهی به موقع انجام شد ؟", list: [] },
+ { id: 1, title: "رفتار و برخورد آرایشگر چگونه بود ؟", choices: ["بسیار خوب", "خوب", "معمولی", "بد"] },
+ { id: 2, title: "میزان تمیزی و بهداشت وسایل چقدر بود تا خط دوم برسد ؟" },
+ { id: 3, title: "آیا وقت دهی به موقع انجام شد ؟" },
],
},
+ { id: 2, img: waitingIcon, checked: false, title: "فرم شماره 2", description: "سوالات تخصصی ترمیم" },
+ { id: 3, img: waitingIcon, checked: false, title: "فرم شماره 3", description: "سوالات تخصصی ترمیم" },
+ { id: 4, img: waitingIcon, checked: false, title: "فرم شماره 4", description: "سوالات تخصصی ترمیم" },
];
const OpinionSMS: React.FC = () => {
- const [opinionSMSListState, setOpinionSMSListState] = useState(opinionSMSListItemsTest);
- const [opinionSMSFormsState] = useState(opinionSMSFormsListItemsTest);
+ const [customers] = useState
-
-
- setSearchTerm(e.target.value)}
- className="w-full bg-[#7878801F] py-2 rounded-full px-10"
- />
-