diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-02-27 01:52:55 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-03-06 18:56:47 +0100 |
commit | 098d6f9bb1fd26f2d192db497992ab95b258ce55 (patch) | |
tree | 22905f87e6ad53032b6ff39bb3af274df2f6287c /packages/renderer/src/components/locationBar/NavigationButtons.tsx | |
parent | refactor: Shared model type factories (diff) | |
download | sophie-098d6f9bb1fd26f2d192db497992ab95b258ce55.tar.gz sophie-098d6f9bb1fd26f2d192db497992ab95b258ce55.tar.zst sophie-098d6f9bb1fd26f2d192db497992ab95b258ce55.zip |
feat: Location bar actions
The buttons and the text field in the location bar shall now affect the
BrowserView of the loaded service.
Some error handling is still needed, e.g., when loading a web page fails
due to a DNS error.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/renderer/src/components/locationBar/NavigationButtons.tsx')
-rw-r--r-- | packages/renderer/src/components/locationBar/NavigationButtons.tsx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/packages/renderer/src/components/locationBar/NavigationButtons.tsx b/packages/renderer/src/components/locationBar/NavigationButtons.tsx index ce59692..e71d3d8 100644 --- a/packages/renderer/src/components/locationBar/NavigationButtons.tsx +++ b/packages/renderer/src/components/locationBar/NavigationButtons.tsx | |||
@@ -48,25 +48,35 @@ function NavigationButtons({ | |||
48 | <IconButton | 48 | <IconButton |
49 | aria-label="Back" | 49 | aria-label="Back" |
50 | disabled={service === undefined || !service.canGoBack} | 50 | disabled={service === undefined || !service.canGoBack} |
51 | onClick={() => service?.goBack()} | ||
51 | > | 52 | > |
52 | {direction === 'ltr' ? <IconArrowBack /> : <IconArrowForward />} | 53 | {direction === 'ltr' ? <IconArrowBack /> : <IconArrowForward />} |
53 | </IconButton> | 54 | </IconButton> |
54 | <IconButton | 55 | <IconButton |
55 | aria-label="Forward" | 56 | aria-label="Forward" |
56 | disabled={service === undefined || !service.canGoForward} | 57 | disabled={service === undefined || !service.canGoForward} |
58 | onClick={() => service?.goForward()} | ||
57 | > | 59 | > |
58 | {direction === 'ltr' ? <IconArrowForward /> : <IconArrowBack />} | 60 | {direction === 'ltr' ? <IconArrowForward /> : <IconArrowBack />} |
59 | </IconButton> | 61 | </IconButton> |
60 | {service?.state === 'loading' ? ( | 62 | {service?.state === 'loading' ? ( |
61 | <IconButton aria-label="Stop"> | 63 | <IconButton aria-label="Stop" onClick={() => service?.stop()}> |
62 | <IconStop /> | 64 | <IconStop /> |
63 | </IconButton> | 65 | </IconButton> |
64 | ) : ( | 66 | ) : ( |
65 | <IconButton aria-label="Refresh" disabled={service === undefined}> | 67 | <IconButton |
68 | aria-label="Refresh" | ||
69 | disabled={service === undefined} | ||
70 | onClick={(event) => service?.reload(event.shiftKey)} | ||
71 | > | ||
66 | <IconRefresh /> | 72 | <IconRefresh /> |
67 | </IconButton> | 73 | </IconButton> |
68 | )} | 74 | )} |
69 | <IconButton aria-label="Home" disabled={service === undefined}> | 75 | <IconButton |
76 | aria-label="Home" | ||
77 | disabled={service === undefined} | ||
78 | onClick={() => service?.goHome()} | ||
79 | > | ||
70 | <IconHome /> | 80 | <IconHome /> |
71 | </IconButton> | 81 | </IconButton> |
72 | </Box> | 82 | </Box> |