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,11 +357,16 @@ const EditView = ({
return ( return (
<> <>
<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)]'
: ''
}`}
>
<textarea <textarea
ref={textareaRef} ref={textareaRef}
className={`m-0 resize-none rounded-lg bg-transparent overflow-y-hidden focus:ring-0 focus-visible:ring-0 leading-7 ${ className='m-0 resize-none rounded-lg bg-transparent overflow-y-hidden focus:ring-0 focus-visible:ring-0 leading-7 w-full'
sticky ? 'border border-gray-400/30 px-2 py-1' : 'focus:outline-none'
}`}
onChange={(e) => { onChange={(e) => {
_setContent(e.target.value); _setContent(e.target.value);
}} }}
@ -370,6 +375,7 @@ const EditView = ({
onKeyDown={handleKeyDown} onKeyDown={handleKeyDown}
rows={1} rows={1}
></textarea> ></textarea>
</div>
<div className='text-center mt-2 flex justify-center'> <div className='text-center mt-2 flex justify-center'>
{sticky && ( {sticky && (
<button <button