diff options
| author | Oliver <oliver@mohlin.dev> | 2025-10-03 11:43:06 +0200 |
|---|---|---|
| committer | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-10-10 13:38:06 +0200 |
| commit | cfd0a4e1528c3dc9cc573fc0a1cb6f571c0ac32f (patch) | |
| tree | e5cceaa298f2f1b5501886bb32acc4ab6bf0e03f | |
| parent | 4a6afb7d70208107e95bf1385e9a4ccdeee5d86d (diff) | |
| download | mullvadvpn-cfd0a4e1528c3dc9cc573fc0a1cb6f571c0ac32f.tar.xz mullvadvpn-cfd0a4e1528c3dc9cc573fc0a1cb6f571c0ac32f.zip | |
Use AnimatedList component in device list
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/components/device-list/DeviceList.tsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/device-list/DeviceList.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/device-list/DeviceList.tsx index ce79e980e4..28fd4aa84d 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/device-list/DeviceList.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/components/device-list/DeviceList.tsx @@ -1,20 +1,21 @@ -import { IDevice } from '../../../shared/daemon-rpc-types'; import { Flex, Spinner } from '../../lib/components'; +import { AnimatedList } from '../../lib/components/animated-list'; import { DeviceListItem } from '../device-list-item'; -import List from '../List'; import { useGetDevices } from './hooks'; -const getDeviceKey = (device: IDevice): string => device.id; - export function DeviceList() { const devices = useGetDevices(); const showList = devices.length > 0; return ( <Flex $flexDirection="column" $alignItems="center"> {showList ? ( - <List items={devices} getKey={getDeviceKey} skipInitialAddTransition> - {(device) => <DeviceListItem device={device} />} - </List> + <AnimatedList> + {devices.map((device) => ( + <AnimatedList.Item key={device.id}> + <DeviceListItem device={device} /> + </AnimatedList.Item> + ))} + </AnimatedList> ) : ( <Spinner size="big" /> )} |
