Skip to content

Commit b9bf341

Browse files
committed
feat(client): add duplicate check reminder and improve form UX
1 parent 9b9af13 commit b9bf341

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

client/localization/ar.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
"title": "ارفع ميم",
2424
"description": "ارفع الميم المفضل عندك",
2525
"note": "رجاء بلاش ميمز مسيئة او تحتوي علي شتايم!",
26+
"duplicate-check": "رجاء ابحث الأول عشان تتأكد إن الميم ده مش موجود",
2627
"name": "اسم",
2728
"name-placeholder": "أدخل اسم بيوصف الميم",
2829
"tags": "Tags",
29-
"tags-placeholder": "أضف tags...",
30+
"tags-placeholder": "ابدأ الكتابة لإنشاء أو إضافة tags...",
3031
"tags-note": "زود(ي) tags/كلمات (زي اسم الفيلم أو المسرحية، الممثل أو الممثلة، نوع المصدر الخ) عشان تسهل البحث عن الميم ده",
3132
"image-url": "رابط الصورة",
3233
"image-url-placeholder": "رابط الصورة من وسائل التواصل الاجتماعي زي X، fb، الخ",

client/localization/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
"title": "Upload a Meme",
1919
"description": "Upload your favorite memes",
2020
"note": "No offensive content please!",
21+
"duplicate-check": "Please search first to make sure this meme doesn't already exist",
2122
"name": "Name",
2223
"name-placeholder": "Enter a descriptive name for your meme",
2324
"tags": "Tags",
24-
"tags-placeholder": "Add tags...",
25+
"tags-placeholder": "Start typing to create or add tags...",
2526
"tags-note": "Include as many tags as you can (such as movie/show name, actor/actress relevant text etc.) to simplify searching for that meme",
2627
"image-url": "Image Url",
2728
"image-url-placeholder": "Image Link from social media like X, fb, etc",

client/src/components/CreateMemeForm.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ const formSchema = z
5656
typeof window === "undefined"
5757
? z.any()
5858
: z
59-
.instanceof(File)
60-
.refine((file) => file.size < MAX_FILE_SIZE, {
61-
message: `Image too big, Your image must be less than ${Math.floor(
62-
MAX_FILE_SIZE / 1000000,
63-
)} MB`,
64-
})
65-
.optional(),
59+
.instanceof(File)
60+
.refine((file) => file.size < MAX_FILE_SIZE, {
61+
message: `Image too big, Your image must be less than ${Math.floor(
62+
MAX_FILE_SIZE / 1000000,
63+
)} MB`,
64+
})
65+
.optional(),
6666
})
6767
.refine(
6868
(data) => {
@@ -249,6 +249,9 @@ export default function CreateMeme({
249249
<DialogDescription>
250250
{t("description")}
251251
</DialogDescription>
252+
<DialogDescription className="font-medium text-blue-600">
253+
{t("duplicate-check")}
254+
</DialogDescription>
252255
<DialogDescription className="font-medium text-red-500">
253256
{t("note")}
254257
</DialogDescription>
@@ -425,9 +428,8 @@ export default function CreateMeme({
425428
"id" in state.data && (
426429
<Button asChild onClick={handleCancel}>
427430
<Link
428-
href={`/meme/${
429-
(state.data as unknown as Meme).id
430-
}`}
431+
href={`/meme/${(state.data as unknown as Meme).id
432+
}`}
431433
>
432434
Meme Page
433435
</Link>

0 commit comments

Comments
 (0)