diff options
| author | Oliver <oliver@mohlin.dev> | 2025-09-12 13:59:21 +0200 |
|---|---|---|
| committer | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-10-10 13:36:20 +0200 |
| commit | 169ab74ff83ca051b6a064fee51d3efaeeef51cd (patch) | |
| tree | c963aa5daa304f63a275b1f3a53fcd8109f6f758 | |
| parent | 37b2ddef286beccb078643510eb3c345b804aded (diff) | |
| download | mullvadvpn-169ab74ff83ca051b6a064fee51d3efaeeef51cd.tar.xz mullvadvpn-169ab74ff83ca051b6a064fee51d3efaeeef51cd.zip | |
Add link to manage devices in account view
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/components/views/account/components/device-name-row/DeviceNameRow.tsx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/views/account/components/device-name-row/DeviceNameRow.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/views/account/components/device-name-row/DeviceNameRow.tsx index 1687fe0473..c47489de6a 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/views/account/components/device-name-row/DeviceNameRow.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/components/views/account/components/device-name-row/DeviceNameRow.tsx @@ -1,6 +1,11 @@ +import React from 'react'; import styled from 'styled-components'; +import { messages } from '../../../../../../shared/gettext'; +import { RoutePath } from '../../../../../../shared/routes'; import { Flex, Text } from '../../../../../lib/components'; +import { Link } from '../../../../../lib/components/link'; +import { TransitionType, useHistory } from '../../../../../lib/history'; import { useSelector } from '../../../../../redux/store'; import DeviceInfoButton from '../../../../DeviceInfoButton'; @@ -9,14 +14,27 @@ const StyledText = styled(Text)` `; export function DeviceNameRow() { + const history = useHistory(); const deviceName = useSelector((state) => state.account.deviceName); + const navigateToManageDevices = React.useCallback(() => { + history.push(RoutePath.manageDevices, { transition: TransitionType.push }); + }, [history]); + return ( <Flex $justifyContent="space-between"> <Flex $gap="small" $alignItems="center"> <StyledText variant="bodySmallSemibold">{deviceName}</StyledText> <DeviceInfoButton /> </Flex> + <Link as="button" onClick={navigateToManageDevices}> + <Link.Text> + { + // TRANSLATORS: Link text in the account view to navigate to the manage devices view. + messages.pgettext('account-view', 'Manage devices') + } + </Link.Text> + </Link> </Flex> ); } |
