Skip to content

Commit

Permalink
XS-30: adds translation-blacklist tag for DatePicker and Key
Browse files Browse the repository at this point in the history
  • Loading branch information
kirtesh-xola committed Apr 12, 2024
1 parent 4f95451 commit 1607d45
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/DatePicker/DatePickerPopover.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const DefaultInput = forwardRef(({ className, ...rest }, reference) => {
<CalendarIcon className="z-10 inline-block" />
</div>

<Input className={clsx("cursor-pointer px-8", className)} {...rest} />
<Input className={clsx("no-translate cursor-pointer px-8", className)} {...rest} />

<div className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3">
<DownArrowIcon className="inline-block" />
Expand Down
5 changes: 3 additions & 2 deletions src/components/DatePicker/LocalizedDayPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { Context } from "../Provider";
import DayPicker, { DayPickerProps } from "react-day-picker";
import { forwardRef, useEffect, useState } from "react";
import { getLocalizationProps, LocaleCode, LocalizationProps } from "./DatePicker.helpers";
import clsx from "clsx";

export const LocalizedDayPicker = forwardRef<any, DayPickerProps>((props, ref) => {
export const LocalizedDayPicker = forwardRef<any, DayPickerProps>(({ className, ...rest }, ref) => {
const { locale } = useContext(Context);
const [localizationProps, setLocalizationProps] = useState<Partial<LocalizationProps>>({});

Expand All @@ -17,5 +18,5 @@ export const LocalizedDayPicker = forwardRef<any, DayPickerProps>((props, ref) =
getLocalizationProps(locale as LocaleCode).then(setLocalizationProps);
}, [locale]);

return <DayPicker ref={ref} {...localizationProps} {...props} />;
return <DayPicker ref={ref} className={clsx("no-translate", className)} {...localizationProps} {...rest} />;
});
2 changes: 1 addition & 1 deletion src/components/Key.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const Key = ({ char, className, ...rest }) => {
<div
className={clsx(
"ui-key",
"inline-flex h-5 items-center justify-center rounded bg-gray-lighter py-1 px-2 text-xs font-semibold text-gray",
"no-translate inline-flex h-5 items-center justify-center rounded bg-gray-lighter py-1 px-2 text-xs font-semibold text-gray",
key.length === 1 && "w-5",
className,
)}
Expand Down

0 comments on commit 1607d45

Please sign in to comment.