Refactor DashboardNavigation and WebAppSwitcher components to improve layout and user interaction. Adjust padding in DashboardNavigation and replace Tooltip with KeyboardShortcut in WebAppSwitcher for enhanced accessibility and streamlined code.
This commit is contained in:
parent
8fbcc67230
commit
991c10d48a
@ -225,7 +225,7 @@ const DashboardNavigation = () => {
|
|||||||
align='center'
|
align='center'
|
||||||
style={{ marginTop: '-2px', marginRight: '6px' }}
|
style={{ marginTop: '-2px', marginRight: '6px' }}
|
||||||
>
|
>
|
||||||
<Space>
|
<Space style={{ paddingTop: '2px' }}>
|
||||||
<WebAppSwitcher />
|
<WebAppSwitcher />
|
||||||
<KeyboardShortcut
|
<KeyboardShortcut
|
||||||
shortcut='alt+q'
|
shortcut='alt+q'
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
import { useContext } from 'react'
|
import { useContext } from 'react'
|
||||||
import { useLocation, useNavigate } from 'react-router-dom'
|
import { useLocation, useNavigate } from 'react-router-dom'
|
||||||
import { Button, Tooltip } from 'antd'
|
import { Button } from 'antd'
|
||||||
import { ElectronContext } from '../context/ElectronContext'
|
import { ElectronContext } from '../context/ElectronContext'
|
||||||
import OpenInAppIcon from '../../Icons/OpenInAppIcon'
|
import OpenInAppIcon from '../../Icons/OpenInAppIcon'
|
||||||
import OpenInBrowserIcon from '../../Icons/OpenInBrowserIcon'
|
import OpenInBrowserIcon from '../../Icons/OpenInBrowserIcon'
|
||||||
import config from '../../../config'
|
import config from '../../../config'
|
||||||
|
import KeyboardShortcut from './KeyboardShortcut'
|
||||||
|
|
||||||
const WebAppSwitcher = () => {
|
const WebAppSwitcher = () => {
|
||||||
const { isElectron, openExternalUrl } = useContext(ElectronContext)
|
const { isElectron, openExternalUrl } = useContext(ElectronContext)
|
||||||
@ -42,17 +43,14 @@ const WebAppSwitcher = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<KeyboardShortcut shortcut='alt+w' hint='ALT W' onTrigger={handleClick}>
|
||||||
title={isElectron ? 'Open in browser' : 'Open in app'}
|
|
||||||
arrow={false}
|
|
||||||
>
|
|
||||||
<Button
|
<Button
|
||||||
icon={isElectron ? <OpenInBrowserIcon /> : <OpenInAppIcon />}
|
icon={isElectron ? <OpenInBrowserIcon /> : <OpenInAppIcon />}
|
||||||
type='text'
|
type='text'
|
||||||
style={{ marginTop: '4px' }}
|
style={{ marginTop: '4px' }}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</KeyboardShortcut>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user