Skip to content

Commit 12e78a7

Browse files
chore: add default reading direction to atoms wrapper (#17710)
1 parent 277b3e0 commit 12e78a7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

packages/platform/atoms/cal-provider/CalProvider.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export type CalProviderProps = {
6767
children?: ReactNode;
6868
clientId: string;
6969
accessToken?: string;
70-
options: { refreshUrl?: string; apiUrl: string };
70+
options: { refreshUrl?: string; apiUrl: string; readingDirection?: "ltr" | "rtl" };
7171
autoUpdateTimezone?: boolean;
7272
onTimezoneChange?: () => void;
7373
version?: API_VERSIONS_ENUM;

packages/platform/atoms/hooks/useAtomsContext.ts

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type http from "../lib/http";
88
export interface IAtomsContextOptions {
99
refreshUrl?: string;
1010
apiUrl: string;
11+
readingDirection?: "ltr" | "rtl";
1112
}
1213

1314
export interface IAtomsContext {

packages/platform/atoms/src/components/atoms-wrapper.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { ReactNode } from "react";
22

33
import { classNames } from "@calcom/lib";
44

5+
import { useAtomsContext } from "../../hooks/useAtomsContext";
56
import { CALCOM_ATOMS_WRAPPER_CLASS } from "../constants/styles";
67

78
export const AtomsWrapper = ({
@@ -11,8 +12,11 @@ export const AtomsWrapper = ({
1112
children: ReactNode;
1213
customClassName?: string;
1314
}) => {
15+
const { options } = useAtomsContext();
1416
return (
15-
<div className={classNames(`${CALCOM_ATOMS_WRAPPER_CLASS} m-0 w-auto p-0`, customClassName)}>
17+
<div
18+
dir={options?.readingDirection ?? "ltr"}
19+
className={classNames(`${CALCOM_ATOMS_WRAPPER_CLASS} m-0 w-auto p-0`, customClassName)}>
1620
{children}
1721
</div>
1822
);

0 commit comments

Comments
 (0)