feat: Add More Translation Text & Minor UI Fixes (#861)

* config token translation

* more translation and fix

* fix conflict

* fix(DialogTemplate) bug with the spec.tsx, localize hooks need to be in a recoil root

* small clean up

* fix(NewTopic) in endpoint

* fix(RecoilRoot)

* test(DialogTemplate.spec) used data-testid

* fix(DialogTemplate)

* some cleanup

---------

Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com>
This commit is contained in:
Marco Beretta 2023-09-04 15:23:26 +02:00 committed by GitHub
parent 28230d9305
commit ac8b898495
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 333 additions and 206 deletions

View file

@ -8,6 +8,7 @@ import {
DialogTitle,
} from './';
import { cn } from '~/utils/';
import { useLocalize } from '~/hooks';
type SelectionProps = {
selectHandler?: () => void;
@ -27,9 +28,11 @@ type DialogTemplateProps = {
};
const DialogTemplate = forwardRef((props: DialogTemplateProps, ref: Ref<HTMLDivElement>) => {
const localize = useLocalize();
const { title, description, main, buttons, leftButtons, selection, className, headerClassName } =
props;
const { selectHandler, selectClasses, selectText } = selection || {};
const Cancel = localize('com_ui_cancel');
const defaultSelect =
'bg-gray-900 text-white transition-colors hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-gray-100 dark:text-gray-900 dark:hover:bg-gray-200 dark:focus:ring-gray-400 dark:focus:ring-offset-gray-900';
@ -49,7 +52,7 @@ const DialogTemplate = forwardRef((props: DialogTemplateProps, ref: Ref<HTMLDivE
<DialogFooter>
<div>{leftButtons ? leftButtons : null}</div>
<div className="flex h-auto gap-2">
<DialogClose className="dark:hover:gray-400 border-gray-700">Cancel</DialogClose>
<DialogClose className="dark:hover:gray-400 border-gray-700">{Cancel}</DialogClose>
{buttons ? buttons : null}
{selection ? (
<DialogClose