aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-04-19 18:58:04 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-05-16 00:55:01 +0200
commit6538cd1293eb78ab09bc7c04bbbdc49f8cbc2f09 (patch)
tree988d62e00a90df7a40b20710adabef267a38c532
parentfeat(renderer): Error pages (diff)
downloadsophie-6538cd1293eb78ab09bc7c04bbbdc49f8cbc2f09.tar.gz
sophie-6538cd1293eb78ab09bc7c04bbbdc49f8cbc2f09.tar.zst
sophie-6538cd1293eb78ab09bc7c04bbbdc49f8cbc2f09.zip
fix(renderer): Improve appearance in small windows
Make sure we do not overflow the viewport with the location bar or the error page. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
-rw-r--r--packages/renderer/src/components/App.tsx1
-rw-r--r--packages/renderer/src/components/ThemeProvider.tsx12
-rw-r--r--packages/renderer/src/components/errorPage/ErrorPage.tsx7
-rw-r--r--packages/renderer/src/components/locationBar/ExtraButtons.tsx7
-rw-r--r--packages/renderer/src/components/locationBar/LocationTextField.tsx1
-rw-r--r--packages/renderer/src/components/locationBar/NavigationButtons.tsx7
6 files changed, 19 insertions, 16 deletions
diff --git a/packages/renderer/src/components/App.tsx b/packages/renderer/src/components/App.tsx
index 26e2e01..4a3a5cf 100644
--- a/packages/renderer/src/components/App.tsx
+++ b/packages/renderer/src/components/App.tsx
@@ -95,6 +95,7 @@ function App({ devMode }: { devMode: boolean }): JSX.Element {
95 sx={{ 95 sx={{
96 flex: 1, 96 flex: 1,
97 display: 'flex', 97 display: 'flex',
98 overflow: 'hidden',
98 flexDirection: 'column', 99 flexDirection: 'column',
99 alignItems: 'stretch', 100 alignItems: 'stretch',
100 height: '100%', 101 height: '100%',
diff --git a/packages/renderer/src/components/ThemeProvider.tsx b/packages/renderer/src/components/ThemeProvider.tsx
index 581563b..2ea2186 100644
--- a/packages/renderer/src/components/ThemeProvider.tsx
+++ b/packages/renderer/src/components/ThemeProvider.tsx
@@ -35,9 +35,15 @@ export default observer(
35 35
36 const theme = createTheme({ 36 const theme = createTheme({
37 direction: writingDirection, 37 direction: writingDirection,
38 palette: { 38 palette: shouldUseDarkColors
39 mode: shouldUseDarkColors ? 'dark' : 'light', 39 ? {
40 }, 40 mode: 'dark',
41 divider: 'rgba(255, 255, 255, 0.22)',
42 }
43 : {
44 mode: 'light',
45 divider: 'rgba(0, 0, 0, 0.24)',
46 },
41 components: { 47 components: {
42 MuiBadge: { 48 MuiBadge: {
43 styleOverrides: { 49 styleOverrides: {
diff --git a/packages/renderer/src/components/errorPage/ErrorPage.tsx b/packages/renderer/src/components/errorPage/ErrorPage.tsx
index 571059a..99ca020 100644
--- a/packages/renderer/src/components/errorPage/ErrorPage.tsx
+++ b/packages/renderer/src/components/errorPage/ErrorPage.tsx
@@ -152,7 +152,12 @@ function ErrorPage({
152 > 152 >
153 {icon} 153 {icon}
154 </Typography> 154 </Typography>
155 <Typography component="h1" variant="h3" mb={2}> 155 <Typography
156 component="h1"
157 variant="h3"
158 fontSize={{ xs: '2rem', md: '3rem' }}
159 mb={2}
160 >
156 {title} 161 {title}
157 </Typography> 162 </Typography>
158 <Typography mb={4}>{description}</Typography> 163 <Typography mb={4}>{description}</Typography>
diff --git a/packages/renderer/src/components/locationBar/ExtraButtons.tsx b/packages/renderer/src/components/locationBar/ExtraButtons.tsx
index 1755495..ef90199 100644
--- a/packages/renderer/src/components/locationBar/ExtraButtons.tsx
+++ b/packages/renderer/src/components/locationBar/ExtraButtons.tsx
@@ -37,12 +37,7 @@ function ExtraButtons({
37 }); 37 });
38 38
39 return ( 39 return (
40 <Box 40 <Box display="flex">
41 sx={{
42 display: 'flex',
43 flexDirection: 'row',
44 }}
45 >
46 <IconButton 41 <IconButton
47 aria-label={t('openInBrowser')} 42 aria-label={t('openInBrowser')}
48 disabled={service?.currentUrl === undefined} 43 disabled={service?.currentUrl === undefined}
diff --git a/packages/renderer/src/components/locationBar/LocationTextField.tsx b/packages/renderer/src/components/locationBar/LocationTextField.tsx
index 5563479..30953de 100644
--- a/packages/renderer/src/components/locationBar/LocationTextField.tsx
+++ b/packages/renderer/src/components/locationBar/LocationTextField.tsx
@@ -37,6 +37,7 @@ const LocationTextFieldRoot = styled(FilledInput, {
37 slot: 'Root', 37 slot: 'Root',
38})(({ theme }) => ({ 38})(({ theme }) => ({
39 padding: '0 12px', 39 padding: '0 12px',
40 flex: '1 0 200px',
40 borderRadius: 18, 41 borderRadius: 18,
41 '&.Mui-focused': { 42 '&.Mui-focused': {
42 outline: `2px solid ${theme.palette.primary.main}`, 43 outline: `2px solid ${theme.palette.primary.main}`,
diff --git a/packages/renderer/src/components/locationBar/NavigationButtons.tsx b/packages/renderer/src/components/locationBar/NavigationButtons.tsx
index 219ed90..9c4ebdb 100644
--- a/packages/renderer/src/components/locationBar/NavigationButtons.tsx
+++ b/packages/renderer/src/components/locationBar/NavigationButtons.tsx
@@ -43,12 +43,7 @@ function NavigationButtons({
43 const { direction } = useTheme(); 43 const { direction } = useTheme();
44 44
45 return ( 45 return (
46 <Box 46 <Box display="flex">
47 sx={{
48 display: 'flex',
49 flexDirection: 'row',
50 }}
51 >
52 <IconButton 47 <IconButton
53 aria-label={t('back')} 48 aria-label={t('back')}
54 disabled={service === undefined || !service.canGoBack} 49 disabled={service === undefined || !service.canGoBack}