diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-02-17 03:17:49 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-03-06 18:56:45 +0100 |
commit | 2efa902d42733abafcfcacd6ae8efcea4afe59ae (patch) | |
tree | 168f7f0e1e806b30af68701cff4350bd96f9751c /packages/renderer/src/components/locationBar/NavigationButtons.tsx | |
parent | feat: Basic location bar (diff) | |
download | sophie-2efa902d42733abafcfcacd6ae8efcea4afe59ae.tar.gz sophie-2efa902d42733abafcfcacd6ae8efcea4afe59ae.tar.zst sophie-2efa902d42733abafcfcacd6ae8efcea4afe59ae.zip |
design: Location bar and other UI styling
InputBase paddings are idiosyncratic if there is both a start and an end
adornment. To simplify the styles, we override the styling from InputBase
and compute our own paddings.
The animated color change when switching from a secure site to an
insecure one was distracting, so we disable color animations in the
location bar.
Diffstat (limited to 'packages/renderer/src/components/locationBar/NavigationButtons.tsx')
-rw-r--r-- | packages/renderer/src/components/locationBar/NavigationButtons.tsx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/renderer/src/components/locationBar/NavigationButtons.tsx b/packages/renderer/src/components/locationBar/NavigationButtons.tsx index 82ed657..77b02b6 100644 --- a/packages/renderer/src/components/locationBar/NavigationButtons.tsx +++ b/packages/renderer/src/components/locationBar/NavigationButtons.tsx | |||
@@ -23,6 +23,7 @@ import IconArrowForward from '@mui/icons-material/ArrowForward'; | |||
23 | import IconStop from '@mui/icons-material/Close'; | 23 | import IconStop from '@mui/icons-material/Close'; |
24 | import IconHome from '@mui/icons-material/HomeOutlined'; | 24 | import IconHome from '@mui/icons-material/HomeOutlined'; |
25 | import IconRefresh from '@mui/icons-material/Refresh'; | 25 | import IconRefresh from '@mui/icons-material/Refresh'; |
26 | import { useTheme } from '@mui/material'; | ||
26 | import Box from '@mui/material/Box'; | 27 | import Box from '@mui/material/Box'; |
27 | import IconButton from '@mui/material/IconButton'; | 28 | import IconButton from '@mui/material/IconButton'; |
28 | import { Service } from '@sophie/shared'; | 29 | import { Service } from '@sophie/shared'; |
@@ -34,6 +35,8 @@ function NavigationButtons({ | |||
34 | }: { | 35 | }: { |
35 | service: Service | undefined; | 36 | service: Service | undefined; |
36 | }): JSX.Element { | 37 | }): JSX.Element { |
38 | const { direction } = useTheme(); | ||
39 | |||
37 | return ( | 40 | return ( |
38 | <Box | 41 | <Box |
39 | sx={{ | 42 | sx={{ |
@@ -42,16 +45,16 @@ function NavigationButtons({ | |||
42 | }} | 45 | }} |
43 | > | 46 | > |
44 | <IconButton | 47 | <IconButton |
45 | aria-label="Go back" | 48 | aria-label="Back" |
46 | disabled={service === undefined || !service.canGoBack} | 49 | disabled={service === undefined || !service.canGoBack} |
47 | > | 50 | > |
48 | <IconArrowBack /> | 51 | {direction === 'ltr' ? <IconArrowBack /> : <IconArrowForward />} |
49 | </IconButton> | 52 | </IconButton> |
50 | <IconButton | 53 | <IconButton |
51 | aria-label="Go forward" | 54 | aria-label="Forward" |
52 | disabled={service === undefined || !service.canGoForward} | 55 | disabled={service === undefined || !service.canGoForward} |
53 | > | 56 | > |
54 | <IconArrowForward /> | 57 | {direction === 'ltr' ? <IconArrowForward /> : <IconArrowBack />} |
55 | </IconButton> | 58 | </IconButton> |
56 | {service?.state === 'loading' ? ( | 59 | {service?.state === 'loading' ? ( |
57 | <IconButton aria-label="Stop"> | 60 | <IconButton aria-label="Stop"> |
@@ -62,10 +65,7 @@ function NavigationButtons({ | |||
62 | <IconRefresh /> | 65 | <IconRefresh /> |
63 | </IconButton> | 66 | </IconButton> |
64 | )} | 67 | )} |
65 | <IconButton | 68 | <IconButton aria-label="Home" disabled={service === undefined}> |
66 | aria-label="Go to service homepage" | ||
67 | disabled={service === undefined} | ||
68 | > | ||
69 | <IconHome /> | 69 | <IconHome /> |
70 | </IconButton> | 70 | </IconButton> |
71 | </Box> | 71 | </Box> |