Skip to content

Commit 4c07a59

Browse files
committed
modif: minor modifications in the application.
1 parent 682ee74 commit 4c07a59

File tree

9 files changed

+30
-29
lines changed

9 files changed

+30
-29
lines changed

apps/web/src/components/Checkout/Content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const Content: React.FC<{
8585
}, [onTransactionStatusUpdate, socket]);
8686

8787
return (
88-
<div className="h-full gap-4 md:gap-8 flex flex-col items-center mt-[15vh] mx-auto">
88+
<div className="h-full gap-4 md:gap-8 flex flex-col items-center mt-6 short:mt-6 md:mt-[15vh] mx-auto">
8989
<Header />
9090

9191
<Body

apps/web/src/hooks/lesson.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useUser } from "@litespace/headless/context/user";
33
import { useInfiniteLessons } from "@litespace/headless/lessons";
44
import { ILesson, Void } from "@litespace/types";
55
import dayjs from "@/lib/dayjs";
6-
import { sortBy } from "lodash";
6+
import { isEmpty, sortBy } from "lodash";
77

88
export function useFindSortedLessons(): {
99
list: ILesson.FindUserLessonsApiResponse["list"];
@@ -29,33 +29,30 @@ export function useFindSortedLessons(): {
2929
size: 15,
3030
});
3131

32-
// a callback function that returns true if the futureLessons
33-
// state includes the passed lesson id.
34-
const futureIncludes = (lessonId: number): boolean => {
35-
return !!futureLessons.find(({ lesson }) => lesson.id === lessonId);
36-
};
37-
3832
useEffect(() => {
3933
const now = dayjs().subtract(ILesson.Duration.Long, "minutes");
4034

4135
const futureList = lessons.list?.slice(pastLessons.length) || [];
4236
const newFutureLessons = futureList.filter(
43-
({ lesson }) => !futureIncludes(lesson.id)
37+
({ lesson }) => !futureLessons.find((l) => l.lesson.id === lesson.id)
4438
);
4539

4640
const newList =
4741
lessons.list?.slice(futureLessons.length + pastLessons.length) || [];
4842
const newPastLessons = newList.filter((l) => now.isAfter(l.lesson.start));
4943

50-
setFutureLessons((prev) =>
51-
sortBy(
52-
[...prev, ...newFutureLessons],
53-
(l) => !!l.lesson.canceledAt || l.lesson.reported,
54-
(l) => l.lesson.start
55-
)
56-
);
44+
if (!isEmpty(newFutureLessons)) {
45+
setFutureLessons((prev) =>
46+
sortBy(
47+
[...prev, ...newFutureLessons],
48+
(l) => !!l.lesson.canceledAt || l.lesson.reported,
49+
(l) => l.lesson.start
50+
)
51+
);
52+
}
53+
5754
setPastLessons((prev) => [...prev, ...newPastLessons]);
58-
}, [lessons.list, futureLessons.length, pastLessons.length]);
55+
}, [lessons.list, futureLessons, futureLessons.length, pastLessons.length]);
5956

6057
return useMemo(
6158
() => ({

apps/web/src/pages/Root.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ const Root: React.FC = () => {
130130
!cache.load(CacheKey.TourFinished)
131131
) {
132132
navigate(Web.Tutors);
133-
studentTour.start();
133+
// studentTour.start();
134134
return;
135135
}
136136
return navigate(Web.StudentDashboard);
137137
}
138-
}, [navigate, location.pathname, user, publicRoute, meta, studentTour]);
138+
}, [navigate, location.pathname, user, publicRoute, meta]);
139139

140140
const showNavigation = useMemo(() => {
141141
if (params.get("nav") === "false") return false;

packages/ui/src/components/ConfirmationDialog/ConfirmationDialog.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ export const ConfirmationDialog: React.FC<{
154154
aria-describedby={description}
155155
dir="rtl"
156156
className={cn(
157-
"fixed bg-natural-50 border border-border-strong rounded-xl shadow-lg shadow-dialog-confirm p-6 z-confirm-dialog-content",
157+
"fixed bg-natural-50 border border-border-strong rounded-xl",
158+
"shadow-lg shadow-dialog-confirm p-6 z-confirm-dialog-content",
158159
{
159160
"left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2":
160161
dialogPosition === "center",
@@ -165,7 +166,7 @@ export const ConfirmationDialog: React.FC<{
165166
className
166167
)}
167168
>
168-
<div className="flex items-center justify-between mb-4">
169+
<div className="flex max-h-screen items-center justify-between mb-4">
169170
<div
170171
className={cn(
171172
"w-12 h-12 border-8 rounded-full flex items-center justify-center",

packages/ui/src/components/Dialog/Dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const Dialog: React.FC<{
120120
dir="rtl"
121121
aria-describedby={description}
122122
className={cn(
123-
"fixed bg-natural-50 focus-visible:ring-brand-500 overflow-hidden z-dialog",
123+
"fixed max-h-screen bg-natural-50 focus-visible:ring-brand-500 overflow-hidden z-dialog",
124124
{
125125
"w-full": !mq.sm,
126126
"p-4 sm:p-6": variant === "default",

packages/ui/src/components/IframeDialog/IframeDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const IframeDialog: React.FC<{
4141
) : (
4242
<div
4343
className={cn(
44-
"w-full h-full sm:w-[512px] sm:h-[750px] bg-natural-50",
44+
"w-full h-full sm:w-[512px] sm:h-[750px] bg-natural-50 max-h-[calc(100vh-64px)]",
4545
"absolute top-16 sm:top-1/2 sm:left-1/2 sm:-translate-x-1/2 sm:-translate-y-1/2 z-iframe-dialog-conent"
4646
)}
4747
>

packages/ui/src/components/Lessons/CancelLesson/CancelLesson.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ export const CancelLesson: React.FC<{
2525
className="!w-[400px] text-caption text-natural-700"
2626
actions={{
2727
primary: {
28-
label: intl("labels.confirm"),
28+
label: intl("labels.i-will-continue"),
2929
onClick: close,
3030
},
3131
secondary: {
32-
label: isStudent ? intl("labels.go-back") : intl("labels.cancel"),
32+
label: intl("labels.cancel-lesson"),
3333
onClick: onCancel,
3434
loading: loading,
3535
disabled: loading,

packages/ui/src/locales/ar-eg.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,8 @@
918918
"book-lesson.edit": "تعديل الموعد",
919919
"book-lesson.loading-slots": "برجاء الانتظار، جاري احضار جدول {tutor}",
920920
"book-lesson.error-slots": "عذرًا، حدث خطأ أثناء تحميل الجدول!",
921-
"book-lesson.empty-slots": "لا توجد مواعيد متاحة",
922-
"book-lesson.empty-slots-at-this-time": "لا توجد مواعيد متاحة في هذا الوقت",
921+
"book-lesson.empty-slots": "جميع المواعيد المتاحة محجوزة",
922+
"book-lesson.empty-slots-at-this-time": "جميع المواعيد المتاحة في هذا الوقت محجوزة",
923923
"book-lesson.success": "تم حجز الحصة بنجاح مع {tutor}",
924924
"book-lesson.error": "حدث خطأ أثناء حجز الحصة، برجاء المحاولة مرة أخرى",
925925
"book-lesson.success.activate-notifications.desc": "الاشعارات هي وسيلة ممتازة حتي تعلم كل جديد في المنصة مثل",
@@ -1056,7 +1056,8 @@
10561056
"labels.currency.egp": "{value} ج.م",
10571057
"labels.next": "التالي",
10581058
"labels.prev": "السابق",
1059-
"labels.confirm": "سأستمر",
1059+
"labels.confirm": "تأكيد",
1060+
"labels.i-will-continue": "سأستمر",
10601061
"labels.report": "إبلاغ",
10611062
"labels.name": "الاسم باللغة العربية",
10621063
"labels.gender": "الهوية",
@@ -1113,13 +1114,14 @@
11131114
"labels.litespace": "LiteSpace",
11141115
"labels.delete": "حذف",
11151116
"labels.share": "مشاركة",
1116-
"labels.go-back": "الغاء الحصة",
1117+
"labels.go-back": "الرجوع",
11171118
"labels.done": "تم",
11181119
"labels.file-upload-done": "اكتمل رفع الملف",
11191120
"labels.file-upload-failed": "تعذر رفع الملف",
11201121
"labels.file-upload-inprogress": "جاري رفع الملف",
11211122
"labels.file-upload-canceled": "تم إلغاء التحميل",
11221123
"labels.cancel": "إلغاء",
1124+
"labels.cancel-lesson": "إلغاء الحصة",
11231125
"labels.back-to-site": "الرجوع الي الموقع",
11241126
"labels.percent.placeholder": "%10",
11251127
"labels.continue-with-cam": "استمرار بالكاميرا",

packages/ui/tailwind.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export default {
9090
"2xs": "400px",
9191
xs: "480px",
9292
"3xl": "1600px",
93+
short: { raw: "(max-height: 600px)" },
9394
},
9495
containers: {
9596
"2md": "30rem",

0 commit comments

Comments
 (0)