Skip to content

Commit 3d1c5a0

Browse files
author
Renan Borges
committed
Fix layout glitches detected in Safari
1 parent 8b68b36 commit 3d1c5a0

File tree

5 files changed

+58
-34
lines changed

5 files changed

+58
-34
lines changed

src/components/App.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
import { Col, NextUIProvider, globalCss } from '@nextui-org/react';
21
import { BrowserRouter, Route, Routes } from 'react-router-dom';
3-
2+
import styled from '@emotion/styled';
43
import '@fontsource/rubik';
54
import backgroundImage from './bg.jpg';
65

7-
import theme from '../theme';
86
import About from './pages/About';
97
import Home from './pages/Home';
108
import Header from './organisms/Header';
119
import Footer from './organisms/Footer';
1210

13-
const ContentCss = {
14-
height: '100%',
11+
const Content = styled.div({
12+
minHeight: '100vh',
1513
backgroundImage: `url(${backgroundImage})`,
1614
backgroundSize: 'cover',
15+
backgroundColor: '$background',
1716
backgroundRepeat: 'no-repeat',
18-
};
17+
display: 'flex',
18+
flexDirection: 'column',
19+
justifyContent: 'space-between',
20+
});
1921

2022
export default () => (
21-
<NextUIProvider theme={theme}>
22-
<BrowserRouter>
23-
<Col css={ContentCss}>
24-
<Header />
25-
<main>
26-
<Routes>
27-
<Route path="/" element={<Home />} />
28-
<Route path="/about" element={<About />} />
29-
</Routes>
30-
</main>
31-
<Footer />
32-
</Col>
33-
</BrowserRouter>
34-
</NextUIProvider>
23+
<BrowserRouter>
24+
<Content>
25+
<Header />
26+
<main>
27+
<Routes>
28+
<Route path="/" element={<Home />} />
29+
<Route path="/about" element={<About />} />
30+
</Routes>
31+
</main>
32+
<Footer />
33+
</Content>
34+
</BrowserRouter>
3535
);

src/components/molecules/Banner.tsx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
import { Link } from 'react-router-dom';
66

77
const Wrapper = styled.div`
8-
height: calc(100vh - 130px);
98
align-items: center;
109
justify-content: center;
1110
display: flex;
@@ -41,16 +40,29 @@ export default () => (
4140
</Text>
4241

4342
<Row css={{
44-
justifyContent: 'center', display: 'flex', paddingTop: 16, gap: 16, '@smMax': { flexWrap: 'wrap' },
43+
justifyContent: 'center',
44+
display: 'flex',
45+
paddingTop: 16,
46+
gap: 16,
47+
'@smMax': { flexWrap: 'wrap' },
4548
}}
4649
>
4750
<Link to="/about">
48-
<Button css={{ padding: '$10' }} color="secondary">
51+
<Button
52+
color="secondary"
53+
css={{
54+
padding: '$12',
55+
minWidth: 220,
56+
}}
57+
>
4958
<Col>
5059
<Text
5160
span
5261
css={{
53-
fontSize: 18, fontWeight: '$bold', display: 'block', height: 16,
62+
fontSize: 20,
63+
fontWeight: '$bold',
64+
display: 'block',
65+
height: 16,
5466
}}
5567
>
5668
Learn more
@@ -60,7 +72,7 @@ export default () => (
6072
</Button>
6173
</Link>
6274
<Button
63-
css={{ padding: '$10' }}
75+
css={{ padding: '$12', minWidth: 220 }}
6476
color="primary"
6577
onClick={() => {
6678
window.location.href = 'https://github.com/viniciusfbb/skia4delphi/releases/latest';
@@ -70,7 +82,10 @@ export default () => (
7082
<Text
7183
span
7284
css={{
73-
fontSize: 18, fontWeight: '$bold', display: 'block', height: 16,
85+
fontSize: 20,
86+
fontWeight: '$bold',
87+
display: 'block',
88+
height: 16,
7489
}}
7590
>
7691
Download

src/components/molecules/Menu.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,32 @@ const Menu = styled.ul`
99
gap: 32px;
1010
`;
1111

12-
const textGradient = {
12+
const textCss = {
13+
fontSize: '1.2em',
1314
'&:hover': {
1415
textGradient: '45deg, $red200 -20%, $red500 50%',
1516
},
17+
'@smMax': {
18+
fontSize: '1em',
19+
flexWrap: 'wrap',
20+
},
1621
};
1722

1823
export default () => (
1924
<Menu>
2025
<li>
2126
<Link to="/about">
22-
<Text weight="bold" css={textGradient}>About</Text>
27+
<Text weight="bold" css={textCss}>About</Text>
2328
</Link>
2429
</li>
2530
<li>
26-
<a href="https://github.com/viniciusfbb/skia4delphi/releases">
27-
<Text weight="bold" css={textGradient}>Download</Text>
31+
<a href="https://github.com/skia4delphi/skia4delphi/releases">
32+
<Text weight="bold" css={textCss}>Download</Text>
2833
</a>
2934
</li>
3035
<li>
31-
<a href="https://github.com/viniciusfbb/skia4delphi">
32-
<Text weight="bold" css={textGradient}>Github</Text>
36+
<a href="https://github.com/skia4delphi/skia4delphi">
37+
<Text weight="bold" css={textCss}>Github</Text>
3338
</a>
3439
</li>
3540
</Menu>

src/components/organisms/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default () => (
3333
display: 'none',
3434
},
3535
}}
36-
href="https://github.com/viniciusfbb/skia4delphi"
36+
href="https://github.com/skia4delphi/skia4delphi"
3737
>
3838
<IoLogoGithub />
3939
</Link>

src/main.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3+
import { NextUIProvider } from '@nextui-org/react';
34

45
import App from './components/App';
6+
import theme from './theme';
57

68
ReactDOM.render(
79
<React.StrictMode>
8-
<App />
10+
<NextUIProvider theme={theme}>
11+
<App />
12+
</NextUIProvider>
913
</React.StrictMode>,
1014
document.getElementById('root'),
1115
);

0 commit comments

Comments
 (0)