Skip to content

Commit 99f71a2

Browse files
committed
fix: add divide-x-reverse to answers when the langDir is rtl
1 parent 1b147ad commit 99f71a2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/app/[locale]/case/[disputeId]/components/Question.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from "react";
22

3-
import { getTranslations } from "next-intl/server";
3+
import clsx from "clsx";
4+
import { getLocale, getTranslations } from "next-intl/server";
45
import { headers } from "next/headers";
56
import Image from "next/image";
67
import Link from "next/link";
7-
8-
import clsx from "clsx";
8+
import { getLangDir } from "rtl-detect";
99

1010
import { type StatusResponseType } from "@/app/api/dispute/[id]/status/query";
1111
import { DisputeDetails } from "@/app/api/dispute/[id]/template/route";
@@ -40,6 +40,9 @@ const Question: React.FC<IQuestion> = async ({ disputeId }) => {
4040
).toString(16)}`;
4141

4242
const t = await getTranslations("case.question");
43+
const locale = await getLocale();
44+
45+
const langDir = getLangDir(locale);
4346

4447
return (
4548
<div className="space-y-6">
@@ -77,7 +80,12 @@ const Question: React.FC<IQuestion> = async ({ disputeId }) => {
7780
</Link>
7881
</div>
7982
) : null}
80-
<div className="grid auto-cols-fr grid-flow-col divide-x-2 divide-stroke">
83+
<div
84+
className={clsx(
85+
"grid auto-cols-fr grid-flow-col divide-x-2 divide-stroke",
86+
langDir === "rtl" && "divide-x-reverse",
87+
)}
88+
>
8189
{disputeDetails.answers.map((answer) => (
8290
<div key={answer.title}>
8391
<div

0 commit comments

Comments
 (0)