모바일 디자인 업데이트 및 quick test 에서 start 와 length 를 직접 입력할 수 있게 함
This commit is contained in:
@@ -38,7 +38,8 @@ export const SettingsPanel: React.FC<Props> = ({
|
||||
const [band, setBand] = useState<FrequencyBand>(FrequencyBand.US);
|
||||
|
||||
// Quick Test Local State
|
||||
const [qtLength, setQtLength] = useState<3 | 4>(4);
|
||||
const [qtLength, setQtLength] = useState<number>(3);
|
||||
const [qtStartAddress, setQtStartAddress] = useState<number>(2);
|
||||
const [qtFormat, setQtFormat] = useState<'hex' | 'ascii'>('hex');
|
||||
|
||||
// Initialize form with reader info when available
|
||||
@@ -58,6 +59,7 @@ export const SettingsPanel: React.FC<Props> = ({
|
||||
useEffect(() => {
|
||||
setQtLength(quickTestConfig.length);
|
||||
setQtFormat(quickTestConfig.format);
|
||||
setQtStartAddress(quickTestConfig.startAddress);
|
||||
}, [quickTestConfig]);
|
||||
|
||||
const handleApplyReaderSettings = () => {
|
||||
@@ -74,7 +76,8 @@ export const SettingsPanel: React.FC<Props> = ({
|
||||
const handleSaveLocalSettings = () => {
|
||||
onSaveQuickTestConfig({
|
||||
length: qtLength,
|
||||
format: qtFormat
|
||||
format: qtFormat,
|
||||
startAddress: qtStartAddress
|
||||
});
|
||||
};
|
||||
|
||||
@@ -309,28 +312,26 @@ export const SettingsPanel: React.FC<Props> = ({
|
||||
이 설정은 브라우저의 로컬 저장소에 저장되며 "Quick Test" 탭의 동작을 제어합니다.
|
||||
</p>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 mb-6">
|
||||
<div className="space-y-3">
|
||||
<label className="text-sm font-medium text-slate-600">Start Address (Word Offset)</label>
|
||||
<input
|
||||
type="number"
|
||||
min={0}
|
||||
value={qtStartAddress}
|
||||
onChange={(e) => setQtStartAddress(parseInt(e.target.value) || 0)}
|
||||
className="w-full bg-white border border-slate-300 rounded-lg px-3 py-2 text-slate-900 focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none transition-all"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-3">
|
||||
<label className="text-sm font-medium text-slate-600">Read/Write Length (Words)</label>
|
||||
<div className="flex items-center gap-4">
|
||||
<label className="flex items-center gap-2 cursor-pointer bg-white px-4 py-2 rounded-lg border border-indigo-100 shadow-sm">
|
||||
<input
|
||||
type="radio"
|
||||
checked={qtLength === 3}
|
||||
onChange={() => setQtLength(3)}
|
||||
className="w-4 h-4 text-indigo-600 focus:ring-indigo-500 border-gray-300"
|
||||
/>
|
||||
<span className="text-sm text-slate-700">3 Words</span>
|
||||
</label>
|
||||
<label className="flex items-center gap-2 cursor-pointer bg-white px-4 py-2 rounded-lg border border-indigo-100 shadow-sm">
|
||||
<input
|
||||
type="radio"
|
||||
checked={qtLength === 4}
|
||||
onChange={() => setQtLength(4)}
|
||||
className="w-4 h-4 text-indigo-600 focus:ring-indigo-500 border-gray-300"
|
||||
/>
|
||||
<span className="text-sm text-slate-700">4 Words</span>
|
||||
</label>
|
||||
</div>
|
||||
<input
|
||||
type="number"
|
||||
min={1}
|
||||
value={qtLength}
|
||||
onChange={(e) => setQtLength(parseInt(e.target.value) || 1)}
|
||||
className="w-full bg-white border border-slate-300 rounded-lg px-3 py-2 text-slate-900 focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none transition-all"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-3">
|
||||
|
||||
Reference in New Issue
Block a user