diff --git a/src/components/practice/InputArea.tsx b/src/components/practice/InputArea.tsx index 33f4543..6c8941b 100644 --- a/src/components/practice/InputArea.tsx +++ b/src/components/practice/InputArea.tsx @@ -14,6 +14,7 @@ interface InputAreaProps { onCompositionStart: (index: number) => void onCompositionEnd: (index: number, value: string) => void onPaste: (e: React.ClipboardEvent) => void + showLockedHint?: boolean } export function InputArea({ @@ -26,6 +27,7 @@ export function InputArea({ onCompositionStart, onCompositionEnd, onPaste, + showLockedHint = true, }: InputAreaProps) { const inputRefs = useRef<(HTMLInputElement | null)[]>([]) @@ -167,7 +169,7 @@ export function InputArea({ {/* 输入锁定提示 */} - {inputLocked && ( + {showLockedHint && inputLocked && ( void onCompositionStart: () => void onCompositionEnd: (value: string) => void + showLockedHint?: boolean } export function ProficientInputArea({ @@ -20,6 +21,7 @@ export function ProficientInputArea({ onChange, onCompositionStart, onCompositionEnd, + showLockedHint = true, }: ProficientInputAreaProps) { const inputRef = useRef(null) @@ -55,7 +57,7 @@ export function ProficientInputArea({ /> - {inputLocked && ( + {showLockedHint && inputLocked && ( + + {showAnswer && !isFinished && ( + +
+ 答案 +
+
+ {currentItem.name} +
+
+ )} +
+ {isFinished && (
@@ -500,6 +518,7 @@ export default function ProcessPurposePracticePage() { }} onCompositionStart={() => handleCompositionStart()} onCompositionEnd={(value) => handleCompositionEnd(value)} + showLockedHint={false} /> ) : ( handleCompositionEnd(index, value)} onPaste={handlePaste} + showLockedHint={false} /> )} @@ -542,34 +562,8 @@ export default function ProcessPurposePracticePage() {
-
- - {showAnswer ? ( - -

- 答案 -

-

- {currentItem.name} -

-
- ) : ( - - Ctrl + H 查看答案 - - )} -
+
+ Ctrl + H 查看答案