Refine rail drawer switching and toggle animations
This commit is contained in:
@@ -224,20 +224,30 @@ export function useDevicesFeature({
|
||||
|
||||
export type DevicesFeature = ReturnType<typeof useDevicesFeature>;
|
||||
|
||||
export function DevicesToggle({ feature, onToggle }: { feature: DevicesFeature; onToggle: () => void }) {
|
||||
export function DevicesToggle({
|
||||
feature,
|
||||
open,
|
||||
onToggle,
|
||||
}: {
|
||||
feature: DevicesFeature;
|
||||
open: boolean;
|
||||
onToggle: () => void;
|
||||
}) {
|
||||
return <RailAction
|
||||
buttonRef={feature.toggleRef}
|
||||
className="client-instructions-toggle client-devices-toggle"
|
||||
open={feature.isOpen}
|
||||
open={open}
|
||||
controls="client-devices"
|
||||
ariaLabel={feature.isOpen ? 'Закрыть устройства' : 'Устройства Gateway'}
|
||||
ariaLabel={open ? 'Закрыть устройства' : 'Устройства Gateway'}
|
||||
label="Устройства"
|
||||
onClick={onToggle}
|
||||
>
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<rect className="client-rail-device-primary" x="3.5" y="5" width="7" height="10" rx="1.5" />
|
||||
<rect className="client-rail-device-secondary" x="13.5" y="8" width="7" height="7" rx="1.5" />
|
||||
<path className="client-rail-device-link" d="M6 19h12M7 15v4M17 15v4" />
|
||||
<path className="client-rail-device-link" d="M7 15v4h3.5M17 15v4h-3.5" />
|
||||
<path className="client-rail-device-bridge" d="M10.5 19h3" />
|
||||
<path className="client-rail-device-pulse" pathLength="1" d="M7 19h10" />
|
||||
</svg>
|
||||
</RailAction>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user