diff --git a/src/components/ui/input/input.tsx b/src/components/ui/input/input.tsx index 9d23b62a2..673339483 100644 --- a/src/components/ui/input/input.tsx +++ b/src/components/ui/input/input.tsx @@ -15,7 +15,7 @@ const messages = defineMessages({ }); /** Possible theme names for an Input. */ -type InputThemes = 'normal' | 'search' +type InputThemes = 'normal' | 'search' | 'transparent' interface IInput extends Pick, 'maxLength' | 'onChange' | 'onBlur' | 'type' | 'autoComplete' | 'autoCorrect' | 'autoCapitalize' | 'required' | 'disabled' | 'onClick' | 'readOnly' | 'min' | 'pattern' | 'onKeyDown' | 'onKeyUp' | 'onFocus' | 'style' | 'id'> { /** Put the cursor into the input on mount. */ @@ -87,9 +87,9 @@ const Input = React.forwardRef( {...filteredProps} type={revealed ? 'text' : type} ref={ref} - className={clsx('text-base placeholder:text-gray-600 dark:placeholder:text-gray-600', { - 'block w-full sm:text-sm ring-1 dark:ring-gray-800 focus:ring-primary-500 focus:border-primary-500 dark:focus:ring-primary-500 dark:focus:border-primary-500': - ['normal', 'search'].includes(theme), + className={clsx('block w-full text-base placeholder:text-gray-600 focus:border-primary-500 sm:text-sm dark:placeholder:text-gray-600 dark:focus:border-primary-500', { + 'ring-1 focus:ring-primary-500 dark:ring-gray-800 dark:focus:ring-primary-500': ['search', 'normal'].includes(theme), + 'px-0 border-none !ring-0': theme === 'transparent', 'text-gray-900 dark:text-gray-100': !props.disabled, 'text-gray-600': props.disabled, 'rounded-md bg-white dark:bg-gray-900 border-gray-400 dark:border-gray-800 black:bg-black': theme === 'normal', diff --git a/src/features/compose/components/compose-form.tsx b/src/features/compose/components/compose-form.tsx index 5311cdc23..101cdce8f 100644 --- a/src/features/compose/components/compose-form.tsx +++ b/src/features/compose/components/compose-form.tsx @@ -62,9 +62,10 @@ interface IComposeForm { event?: string; group?: string; withAvatar?: boolean; + transparent?: boolean; } -const ComposeForm = ({ id, shouldCondense, autoFocus, clickableAreaRef, event, group, withAvatar }: IComposeForm) => { +const ComposeForm = ({ id, shouldCondense, autoFocus, clickableAreaRef, event, group, withAvatar, transparent }: IComposeForm) => { const history = useHistory(); const intl = useIntl(); const dispatch = useAppDispatch(); @@ -258,6 +259,7 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab onSuggestionsFetchRequested={onSuggestionsFetchRequested} onSuggestionsClearRequested={onSuggestionsClearRequested} onSuggestionSelected={onSpoilerSuggestionSelected} + theme={transparent ? 'transparent' : 'normal'} />
@@ -265,7 +267,10 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab { +interface ISpoilerInput extends Pick { composeId: string extends 'default' ? never : string; } @@ -19,6 +19,7 @@ const SpoilerInput = React.forwardRef(({ onSuggestionsFetchRequested, onSuggestionsClearRequested, onSuggestionSelected, + theme, }, ref) => { const intl = useIntl(); const dispatch = useAppDispatch(); @@ -39,6 +40,7 @@ const SpoilerInput = React.forwardRef(({ onSuggestionsFetchRequested={onSuggestionsFetchRequested} onSuggestionsClearRequested={onSuggestionsClearRequested} onSuggestionSelected={onSuggestionSelected} + theme={theme} searchTokens={[':']} id='cw-spoiler-input' className='rounded-md !bg-transparent dark:!bg-transparent' diff --git a/src/features/compose/editor/index.tsx b/src/features/compose/editor/index.tsx index 664afa28b..f05c27a04 100644 --- a/src/features/compose/editor/index.tsx +++ b/src/features/compose/editor/index.tsx @@ -198,7 +198,7 @@ const ComposeEditor = React.forwardRef(({ placeholder={(
diff --git a/src/features/event/event-discussion.tsx b/src/features/event/event-discussion.tsx index f0ba3877c..9d8127d39 100644 --- a/src/features/event/event-discussion.tsx +++ b/src/features/event/event-discussion.tsx @@ -160,7 +160,7 @@ const EventDiscussion: React.FC = (props) => { return ( {me &&
- +
}
= (props) => { autoFocus={false} group={groupId} withAvatar + transparent />
diff --git a/src/layouts/home-layout.tsx b/src/layouts/home-layout.tsx index 0f52c378e..ae87de81d 100644 --- a/src/layouts/home-layout.tsx +++ b/src/layouts/home-layout.tsx @@ -74,6 +74,7 @@ const HomeLayout: React.FC = ({ children }) => { autoFocus={false} clickableAreaRef={composeBlock} withAvatar + transparent />