Skip to content

Lesson 5 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a825552
[UPDATE] global.css + setting light mode
alireza97d Jan 28, 2025
3cdb496
[UPDATE] footer color style
alireza97d Jan 28, 2025
73017fd
[UPDATE] search component color style
alireza97d Jan 28, 2025
bbc1d96
[UPDATE] header color style
alireza97d Jan 28, 2025
93b6036
[UPDATE] last search item - color style
alireza97d Jan 28, 2025
cdc5ae6
[UPDATE] doctor item card changed color style
alireza97d Jan 28, 2025
64f77ba
[UPDATE] filter component color style
alireza97d Jan 28, 2025
e7164e6
[UPDATE] next config for support remote images
alireza97d Jan 28, 2025
9469795
[UPDATE] mock data reduce doctor id
alireza97d Jan 28, 2025
3ba925f
[UPDATE] doctor mock data
alireza97d Jan 28, 2025
a427fba
[UPDATE] doctor mock data
alireza97d Jan 28, 2025
995e5ab
[ADD] doctor page and find correct doctor
alireza97d Jan 28, 2025
cfb5bb2
[UPDATE] created doctor image component
alireza97d Jan 28, 2025
695c5a9
[UPDATE] fixed url
alireza97d Jan 28, 2025
cbf8683
[ADD] doctor page + add doctor image inside page
alireza97d Jan 28, 2025
4a708e4
[ADD] doctor info card
alireza97d Jan 28, 2025
e9bb336
[UPDATE] create basic version component of doctor page
alireza97d Jan 28, 2025
1caac5e
[UPDATE] card component now get custom class in props
alireza97d Jan 28, 2025
fd60744
[ADD] online counsulation component
alireza97d Jan 28, 2025
59e9c34
[ADD] reserve component
alireza97d Jan 28, 2025
39e761f
[ADD] contact component
alireza97d Jan 28, 2025
fcc8971
[UPDATE] contact tel link
alireza97d Jan 28, 2025
0a96da4
[UPDATE] convert en price to persian number
alireza97d Jan 29, 2025
6f99691
[UPDATE] change cursor to pointer for report button
alireza97d Jan 29, 2025
c1195df
[UPDATE] add icons to doctor single page
alireza97d Jan 29, 2025
1af36ed
[ADD] doctor activities card
alireza97d Jan 29, 2025
1879f52
[ADD] doctor about card in single doctor page
alireza97d Jan 29, 2025
5480521
[UPDATE] info avrage rate padding
alireza97d Jan 29, 2025
c9b95c4
[ADD] reating progress bar
alireza97d Jan 29, 2025
330ca8a
[ADD] review items
alireza97d Jan 30, 2025
a2157ec
[UPDATE] fixed name component
alireza97d Jan 30, 2025
cb63824
[ADD] load more btn
alireza97d Jan 30, 2025
12df6b6
[ADD] helpre func timeAgo
alireza97d Jan 31, 2025
9362f4e
[UPDATE] use mock data to doctor page
alireza97d Jan 31, 2025
bb9299b
[ADD] reviews filters
alireza97d Jan 31, 2025
95d78e5
[PRETTIER] fixed prettier format
alireza97d Jan 31, 2025
1ab085c
[FIX] build bug
alireza97d Jan 31, 2025
191d2ce
[UPDATE] fixed Hydration errors
alireza97d Feb 1, 2025
46bb3f2
[PRETTIER] update code formating
alireza97d Feb 1, 2025
fd42be9
[UPDATE] fixed code based on codective doc
alireza97d Feb 17, 2025
5de72f4
[UPDATE] set persian number
alireza97d Feb 17, 2025
ff72b85
[PRETTIER] fixed format
alireza97d Feb 17, 2025
0704568
[UPDATE] replace google font with locale font
alireza97d Feb 18, 2025
0389dcc
[PRETTIER] fixed code format
alireza97d Feb 18, 2025
d967813
[FIXED] fixed and improved doctor page
alireza97d Mar 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "cdn.paziresh24.com",
},
],
},
};

export default nextConfig;
15 changes: 15 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"dependencies": {
"clsx": "^2.1.1",
"dompurify": "^3.2.4",
"next": "14.2.20",
"react": "^18",
"react-dom": "^18",
Expand Down
33 changes: 33 additions & 0 deletions src/app/doctor/[[...slug]]/components/about/about.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"use client";

import { ReactNode } from "react";

import DOMPurify from "dompurify";

import CardComponent from "@/components/card/card.component";

import styles from "./about.module.css";

type Props = {
aboutText: string;
};

const AboutComponent: React.FC<Props> = ({ aboutText }): ReactNode => {
const sanitizedHTML = DOMPurify.sanitize(aboutText ?? "");

return (
<div className={styles.container}>
<div className={styles.title}>
<h2>درباره دکتر</h2>
</div>
<CardComponent>
<div
dangerouslySetInnerHTML={{ __html: sanitizedHTML }}
className={styles.about}
/>
</CardComponent>
</div>
);
};

export default AboutComponent;
26 changes: 26 additions & 0 deletions src/app/doctor/[[...slug]]/components/about/about.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.container {
display: grid;
gap: 1rem;

.title {
h2 {
font-size: var(--fz-300);
}
}

.about div {
font-size: var(--fz-200);

h2 {
font-size: var(--fz-300);
}

> *:not(:first-child) {
margin-block-start: 1rem;
}

ol {
margin-inline-start: 2rem;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { ReactElement } from "react";

import CardComponent from "@/components/card/card.component";

import MingcuteCommentLine from "@/icons/MingcuteCommentLine";
import MingcuteAwardLine from "@/icons/MingcuteAwardLine";

import styles from "./activities.module.css";

type Props = {
doctorName: string;
activeCounsulate: number;
};

const ActivitiesComponent: React.FC<Props> = ({
doctorName,
activeCounsulate,
}): ReactElement => {
return (
<div className={styles.container}>
<div className={styles.title}>
<h2>فعالیت‌ها</h2>
</div>
<CardComponent>
<div className={styles.activity}>
<ul>
<li>
<MingcuteCommentLine />
<span>
<span className={styles.consulation_count}>
{activeCounsulate.toLocaleString()}
</span>
&nbsp;
<span>مشاوره فعال</span>
</span>
</li>

<li>
<MingcuteAwardLine />
<span>
پذیرش24 بیش از 2 سال و 11 ماه افتخار میزبانی از صفحه اختصاصی
دکتر {doctorName} را داشته است.
</span>
</li>
</ul>
</div>
</CardComponent>
</div>
);
};

export default ActivitiesComponent;
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.container {
display: grid;
gap: 1rem;

.title {
h2 {
font-size: var(--fz-300);
}
}

.activity {
ul li {
display: flex;
align-items: center;
gap: 0.5rem;

background-color: var(--color-surface-400);

font-size: var(--fz-200);

border-radius: var(--border-radius);

padding-inline: 1rem;
padding-block: 1rem;

svg {
inline-size: 1.5rem;
block-size: 1.5rem;
}
.consulation_count {
font-weight: 600;
}
}

ul li:not(:first-child) {
margin-block-start: 0.8rem;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { ReactElement } from "react";

import CardComponent from "@/components/card/card.component";
import { MingcuteAIFill } from "@/icons/MingcuteAIFill";

import styles from "./characteristics.module.css";

type Props = {
doctorName: string;
characteristics: string[];
};

const CharacteristicsComponent: React.FC<Props> = ({
doctorName,
characteristics,
}): ReactElement => {
return (
<div className={styles.characteristics}>
<div className={styles.title}>
<h2>ویژگی‌های دکتر {doctorName}</h2>
</div>
<CardComponent>
<div className={styles["characteristics-item"]}>
<ul>
{characteristics?.map((characteristic, index) => {
return (
<li key={index}>
<MingcuteAIFill />
{characteristic}
</li>
);
})}
</ul>
</div>
</CardComponent>
</div>
);
};

export default CharacteristicsComponent;
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.characteristics {
display: grid;
gap: 1rem;

.title {
h2 {
font-size: var(--fz-300);
}
}

.characteristics-item {
ul {
border-right: 2px dotted var(--color-gray-80);

padding-inline-start: 0.75rem;

font-size: var(--fz-200);
line-height: 1.5rem;

li {
display: flex;
align-items: center;
gap: 0.5rem;

svg {
inline-size: 1rem;
block-size: 1rem;
}
}

li span {
font-weight: 600;
font-size: var(--fz-300);
}
}

ul li:not(:first-child) {
margin-block-start: 0.5rem;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { ReactNode } from "react";

import CardComponent from "@/components/card/card.component";

import MingcutePencilLine from "@/icons/MingcutePencilLine";
import MingcuteCalendar2Line from "@/icons/MingcuteCalendar2Line";
import MingcutePhoneLine from "@/icons/MingcutePhoneLine";
import MingcuteLocationLine from "@/icons/MingcuteLocationLine";

import styles from "./contact.module.css";

type Props = {
address: string;
doctorName: string;
};

const extractCityAndAddress = (fullAddress: string) => {
const parts = fullAddress.split(/[,.،]/);
const city = parts[0]?.trim() || "";
const remainingAddress = parts.slice(1).join(", ").trim();
return { city, remainingAddress };
};

const ContactComponent: React.FC<Props> = ({
address,
doctorName,
}): ReactNode => {
const { city, remainingAddress } = extractCityAndAddress(address);

return (
<div className={styles.container}>
<div className={styles.title}>
<h2>آدرس و تلفن تماس</h2>

<div className={styles.report}>
<MingcutePencilLine />
<span>گزارش تلفن و آدرس صحیح</span>
</div>
</div>

<CardComponent>
<div className={styles.contact}>
<strong>مطب دکتر {doctorName}</strong>
<address>
<span>{city} - </span>
<span>{remainingAddress}</span>
</address>

<div className={styles.action_btn}>
<ul>
<li>
<button>
<MingcuteCalendar2Line />
<span>برنامه کاری پزشک</span>
</button>
</li>

<li>
<a href="tel:02155635553">
<button>
<MingcutePhoneLine />
<span>021-55635553</span>
</button>
</a>
</li>

<li>
<button>
<MingcuteLocationLine />
<span>مشاهده در نقشه و مسیریابی</span>
</button>
</li>
</ul>
</div>
</div>
</CardComponent>
</div>
);
};

export default ContactComponent;
Loading