aboutsummaryrefslogtreecommitdiffstats
path: root/packages/renderer/src/components/sidebar
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-04-20 00:28:38 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-05-16 00:55:01 +0200
commit9462cec9a7dc5b6722df464559721cd2445636e6 (patch)
tree08a266cc2c6d65e55ffe76b279f310d1cf517bdd /packages/renderer/src/components/sidebar
parentfix(renderer): Improve appearance in small windows (diff)
downloadsophie-9462cec9a7dc5b6722df464559721cd2445636e6.tar.gz
sophie-9462cec9a7dc5b6722df464559721cd2445636e6.tar.zst
sophie-9462cec9a7dc5b6722df464559721cd2445636e6.zip
feat: Always show location bar on error
The location bar should be visible on error page to let people see and change the URL if needed. Additionally, it must be visible on insecure connections to show people that the connection if not secure. In the future, the location bar should also be shown if the loaded website is uncommon in the context of the current service, i.e., it is not explcitly allowlisted by the recipe. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/renderer/src/components/sidebar')
-rw-r--r--packages/renderer/src/components/sidebar/ToggleLocationBarButton.tsx12
1 files changed, 8 insertions, 4 deletions
diff --git a/packages/renderer/src/components/sidebar/ToggleLocationBarButton.tsx b/packages/renderer/src/components/sidebar/ToggleLocationBarButton.tsx
index 325160e..7fc559d 100644
--- a/packages/renderer/src/components/sidebar/ToggleLocationBarButton.tsx
+++ b/packages/renderer/src/components/sidebar/ToggleLocationBarButton.tsx
@@ -47,19 +47,23 @@ function ToggleLocationBarIcon({
47 47
48function ToggleLocationBarButton(): JSX.Element { 48function ToggleLocationBarButton(): JSX.Element {
49 const { t } = useTranslation(); 49 const { t } = useTranslation();
50 const { settings } = useStore(); 50 const {
51 const { selectedService, showLocationBar } = settings; 51 shared: { locationBarVisible, canToggleLocationBar },
52 settings,
53 } = useStore();
54 const { selectedService } = settings;
52 55
53 return ( 56 return (
54 <IconButton 57 <IconButton
55 aria-pressed={showLocationBar} 58 disabled={!canToggleLocationBar}
59 aria-pressed={locationBarVisible}
56 aria-controls={LOCATION_BAR_ID} 60 aria-controls={LOCATION_BAR_ID}
57 aria-label={t('toolbar.toggleLocationBar')} 61 aria-label={t('toolbar.toggleLocationBar')}
58 onClick={() => settings.toggleLocationBar()} 62 onClick={() => settings.toggleLocationBar()}
59 > 63 >
60 <ToggleLocationBarIcon 64 <ToggleLocationBarIcon
61 loading={selectedService?.loading ?? false} 65 loading={selectedService?.loading ?? false}
62 show={showLocationBar} 66 show={locationBarVisible}
63 /> 67 />
64 </IconButton> 68 </IconButton>
65 ); 69 );