style: update class names for improved consistency in text editor and switch components

This commit is contained in:
Ardeman 2025-03-06 09:01:26 +08:00
parent 32b435d762
commit d27c068f39
4 changed files with 6 additions and 6 deletions

View File

@ -110,7 +110,7 @@ export const EditorMenuBar = (properties: TProperties) => {
return ( return (
<> <>
<div className="flex items-start justify-between gap-4 rounded-[5px_5px_0_0] px-4 py-3"> <div className="flex items-start justify-between gap-4 px-4 py-3">
<div className="flex divide-x"> <div className="flex divide-x">
<div className="flex max-w-[150px] flex-wrap items-start gap-1 px-1"> <div className="flex max-w-[150px] flex-wrap items-start gap-1 px-1">
<EditorButton <EditorButton

View File

@ -122,7 +122,7 @@ export const TextEditor = <TFormValues extends Record<string, unknown>>(
disabled={disabled} disabled={disabled}
/> />
) : ( ) : (
<div className={twMerge('', className)}> <div className={twMerge('rounded-md', className)}>
<EditorMenuBar <EditorMenuBar
disabled={disabled} disabled={disabled}
category={category} category={category}
@ -134,7 +134,7 @@ export const TextEditor = <TFormValues extends Record<string, unknown>>(
editor={editor} editor={editor}
id={id ?? generatedId} id={id ?? generatedId}
className={twMerge( className={twMerge(
'prose prose-headings:my-0 prose-p:my-0 max-h-96 max-w-none cursor-text overflow-y-auto rounded-[0_0_5px_5px] border border-[#D2D2D2] p-2', 'prose prose-headings:my-0 prose-p:my-0 max-h-96 max-w-none cursor-text overflow-y-auto rounded-b-md p-2',
inputClassName, inputClassName,
)} )}
onClick={() => editor?.commands.focus()} onClick={() => editor?.commands.focus()}

View File

@ -56,7 +56,7 @@ export const Switch = <TFormValues extends Record<string, unknown>>(
control={control} control={control}
rules={rules} rules={rules}
render={({ field }) => ( render={({ field }) => (
<div className={twMerge('flex items-center', inputClassName)}> <div className={twMerge('flex items-center', className)}>
<HeadlessSwitch <HeadlessSwitch
checked={field.value} checked={field.value}
onChange={(checked) => { onChange={(checked) => {
@ -64,7 +64,7 @@ export const Switch = <TFormValues extends Record<string, unknown>>(
}} }}
className={twMerge( className={twMerge(
'group relative flex h-7 w-14 cursor-pointer rounded-full bg-[#2E2F7C]/10 p-1 shadow transition-colors duration-200 ease-in-out focus:outline-none data-[checked]:bg-[#2E2F7C]/90 data-[focus]:outline-1 data-[focus]:outline-white', 'group relative flex h-7 w-14 cursor-pointer rounded-full bg-[#2E2F7C]/10 p-1 shadow transition-colors duration-200 ease-in-out focus:outline-none data-[checked]:bg-[#2E2F7C]/90 data-[focus]:outline-1 data-[focus]:outline-white',
className, inputClassName,
)} )}
> >
<span <span

View File

@ -182,7 +182,7 @@ export const CreateContentsPage = () => {
name="is_premium" name="is_premium"
label="Premium" label="Premium"
labelClassName="text-sm font-medium text-[#363636]" labelClassName="text-sm font-medium text-[#363636]"
inputClassName="h-[42px]" className="h-[42px]"
/> />
</div> </div>