优化
This commit is contained in:
@@ -32,46 +32,35 @@ export const MobileExportPropsPanel: React.FC<MobileExportPropsPanelProps> = ({
|
||||
}) => {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
if (locked) return null;
|
||||
|
||||
const paperLabel =
|
||||
paper.type === 'custom' ? `${paper.width}×${paper.height} mm` : paper.type;
|
||||
const summary = `${paperLabel} · ${paper.orientation === 'portrait' ? '纵向' : '横向'}${
|
||||
cutLine.enabled ? ' · 裁切线' : ''
|
||||
}`;
|
||||
|
||||
const toggleOpen = () => {
|
||||
if (locked) return;
|
||||
setOpen((value) => !value);
|
||||
};
|
||||
|
||||
return (
|
||||
<section
|
||||
className={`mobile-export-card mobile-export-props-card ${open ? 'is-open' : ''} ${
|
||||
locked ? 'mobile-export-card-locked' : ''
|
||||
}`}
|
||||
aria-disabled={locked}
|
||||
>
|
||||
<section className={`mobile-export-card mobile-export-props-card ${open ? 'is-open' : ''}`}>
|
||||
<button
|
||||
type="button"
|
||||
className="mobile-export-card-head mobile-export-props-head"
|
||||
onClick={toggleOpen}
|
||||
aria-expanded={open && !locked}
|
||||
disabled={locked}
|
||||
onClick={() => setOpen((value) => !value)}
|
||||
aria-expanded={open}
|
||||
>
|
||||
<Settings className="w-4 h-4 text-indigo-500 shrink-0 mt-0.5" />
|
||||
<div className="flex-1 min-w-0 text-left">
|
||||
<h2>导出属性</h2>
|
||||
<p>{locked ? '上传数据后可配置纸张与裁切线' : summary}</p>
|
||||
<p>{summary}</p>
|
||||
</div>
|
||||
{!locked && (
|
||||
<ChevronDown
|
||||
className={`w-5 h-5 text-slate-400 shrink-0 mt-0.5 transition-transform duration-200 ${
|
||||
open ? 'rotate-180' : ''
|
||||
}`}
|
||||
/>
|
||||
)}
|
||||
<ChevronDown
|
||||
className={`w-5 h-5 text-slate-400 shrink-0 mt-0.5 transition-transform duration-200 ${
|
||||
open ? 'rotate-180' : ''
|
||||
}`}
|
||||
/>
|
||||
</button>
|
||||
|
||||
{open && !locked && (
|
||||
{open && (
|
||||
<div className="mobile-export-card-body">
|
||||
<PaperSettingsPanel
|
||||
theme="mobile"
|
||||
|
||||
Reference in New Issue
Block a user