style: sticky input

This commit is contained in:
Jing Hua 2023-03-05 00:09:00 +08:00
parent bdcaa35b98
commit 17e37a3d79

View file

@ -357,19 +357,25 @@ const EditView = ({
return (
<>
<textarea
ref={textareaRef}
className={`m-0 resize-none rounded-lg bg-transparent overflow-y-hidden focus:ring-0 focus-visible:ring-0 leading-7 ${
sticky ? 'border border-gray-400/30 px-2 py-1' : 'focus:outline-none'
<div
className={`w-full ${
sticky
? 'py-2 md:py-3 px-2 md:px-4 border border-black/10 bg-white dark:border-gray-900/50 dark:text-white dark:bg-gray-700 rounded-md shadow-[0_0_10px_rgba(0,0,0,0.10)] dark:shadow-[0_0_15px_rgba(0,0,0,0.10)]'
: ''
}`}
onChange={(e) => {
_setContent(e.target.value);
}}
value={_content}
onInput={handleInput}
onKeyDown={handleKeyDown}
rows={1}
></textarea>
>
<textarea
ref={textareaRef}
className='m-0 resize-none rounded-lg bg-transparent overflow-y-hidden focus:ring-0 focus-visible:ring-0 leading-7 w-full'
onChange={(e) => {
_setContent(e.target.value);
}}
value={_content}
onInput={handleInput}
onKeyDown={handleKeyDown}
rows={1}
></textarea>
</div>
<div className='text-center mt-2 flex justify-center'>
{sticky && (
<button