260728_05_ENH: 에디터 동적 툴바 사용가능하도록 수정
This commit is contained in:
@@ -23,9 +23,9 @@ export function KriEditorSms({
|
||||
changeSmsType,
|
||||
onEditorReady,
|
||||
onCommandReady,
|
||||
isSmsReadOnly = false,
|
||||
smsMaxBytes = 90,
|
||||
lmsMaxBytes = 2000,
|
||||
isSmsReadOnly = false,
|
||||
}: SmsEditorProps) {
|
||||
const [text, setText] = React.useState(value || '')
|
||||
const textareaRef = React.useRef<HTMLTextAreaElement | null>(null)
|
||||
@@ -79,6 +79,7 @@ export function KriEditorSms({
|
||||
|
||||
return (
|
||||
<div className={cn('mx-auto w-full max-w-[320px]', className)}>
|
||||
{label ? <div className="mb-2 text-sm font-semibold">{label}</div> : null}
|
||||
<div className="relative h-[600px] w-full overflow-hidden rounded-[40px] border-8 border-gray-800 bg-white shadow-2xl">
|
||||
<div className="absolute top-0 left-1/2 z-10 h-6 w-32 -translate-x-1/2 rounded-b-2xl bg-gray-800" />
|
||||
<div className="flex h-full flex-col bg-gray-50 px-4 pt-8 pb-4">
|
||||
@@ -94,18 +95,17 @@ export function KriEditorSms({
|
||||
ref={textareaRef}
|
||||
className="w-full flex-1 resize-none bg-transparent p-4 text-sm leading-relaxed text-gray-700 outline-none"
|
||||
value={text}
|
||||
readOnly={isSmsReadOnly}
|
||||
onChange={(event) => {
|
||||
const next = event.target.value
|
||||
if (calculateBytes(next) <= lmsMaxBytes) commitText(next)
|
||||
}}
|
||||
onBlur={() => flushChange(latestTextRef.current)}
|
||||
placeholder={placeholder}
|
||||
readOnly={isSmsReadOnly}
|
||||
style={{ minHeight: smsTitle ? '320px' : '360px' }}
|
||||
{...textareaInsert.bindSelectionHandlers}
|
||||
/>
|
||||
</div>
|
||||
{label ? <div className="my-2 text-sm font-semibold text-red-600">{label}</div> : null}
|
||||
{byteSize > maxBytes ? (
|
||||
<p className="mt-2 px-2 text-center text-xs font-medium text-red-600">
|
||||
최대 용량을 {byteSize - maxBytes}byte 초과했습니다.
|
||||
|
||||
Reference in New Issue
Block a user