Skip to content

Commit

Permalink
Factor out ArtNetDevices
Browse files Browse the repository at this point in the history
  • Loading branch information
spensbot committed Jun 24, 2024
1 parent 75049bf commit f67ce2a
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/renderer/overlays/Devices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ export default function Devices({}: Props) {
}
</div>
)}
<SubSubTitle>Art-Net</SubSubTitle>
<Input
value={connectable.artNet[0] ?? ''}
onChange={(newVal) => dispatch(setArtNetConnectable([newVal]))}
placeholder="Enter Art-Net IP"
/>
<ArtNetDevices />
</Pane>
<Divider />
<Pane>
Expand Down Expand Up @@ -153,6 +148,22 @@ const SubSubTitle = styled.div`
margin-top: 1rem;
`

function ArtNetDevices() {
const connectable = useControlSelector((state) => state.device.connectable)
const dispatch = useDispatch()

return (
<>
<SubSubTitle>Art-Net</SubSubTitle>
<Input
value={connectable.artNet[0] ?? ''}
onChange={(newVal) => dispatch(setArtNetConnectable([newVal]))}
placeholder="Enter Art-Net IP"
/>
</>
)
}

interface Props2<T> {
device: T
connected: ConnectionId[]
Expand Down

0 comments on commit f67ce2a

Please sign in to comment.