Skip to content

Commit 4f9970b

Browse files
authored
Merge pull request #16 from Douglas019BR/feat-02/improve_frontend
feat 02/improve frontend
2 parents 096e50d + 3a1a9d6 commit 4f9970b

File tree

10 files changed

+400
-31
lines changed

10 files changed

+400
-31
lines changed

frontend/package-lock.json

+129-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@emotion/react": "^11.11.0",
6+
"@emotion/react": "^11.13.5",
77
"@emotion/styled": "^11.11.0",
88
"@mui/icons-material": "^5.11.16",
9+
"@mui/joy": "^5.0.0-beta.48",
910
"@mui/material": "^5.13.0",
1011
"@testing-library/jest-dom": "^5.16.5",
1112
"@testing-library/react": "^13.4.0",

frontend/src/App.jsx

+12-7
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,32 @@ import React from 'react';
22
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
33
import StockPortfolio from './pages/StockPortfolio';
44
import HelloWorldPage from './pages/HelloWorldPage';
5+
import Layout from './components/Layout/index';
56

67
const router = createBrowserRouter([
78
{
89
path: "/",
9-
element: <StockPortfolio />,
10+
element: <Layout />,
1011
children: [
12+
{
13+
path: "",
14+
element: <StockPortfolio />,
15+
},
1116
{
1217
path: "hello",
13-
element: <HelloWorldPage />
14-
}
15-
]
16-
}
18+
element: <HelloWorldPage />,
19+
},
20+
],
21+
},
1722
], {
1823
future: {
1924
v7_startTransition: true,
20-
v7_relativeSplatPath: true
25+
v7_relativeSplatPath: true,
2126
}
2227
});
2328

2429
function App() {
2530
return <RouterProvider router={router} />;
2631
}
2732

28-
export default App;
33+
export default App;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
import { FooterContainer, FooterText } from './styles';
3+
4+
5+
const Footer = () => {
6+
return (
7+
<FooterContainer>
8+
<FooterText>
9+
© {new Date().getFullYear()} COWDOL. Todos os direitos reservados.
10+
</FooterText>
11+
</FooterContainer>
12+
);
13+
};
14+
export default Footer;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { styled } from '@mui/material/styles';
2+
import Box from '@mui/material/Box';
3+
import Typography from '@mui/material/Typography';
4+
5+
export const FooterContainer = styled(Box)(({ theme }) => ({
6+
backgroundColor: theme.palette.background.default,
7+
padding: theme.spacing(2),
8+
textAlign: 'center',
9+
position: 'absolute',
10+
bottom: 0,
11+
width: '100%',
12+
display: 'flex',
13+
justifyContent: 'center',
14+
alignItems: 'center',
15+
height: '60px',
16+
}));
17+
18+
export const FooterText = styled(Typography)(({ theme }) => ({
19+
color: theme.palette.text.secondary,
20+
fontSize: '0.875rem',
21+
}));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import CarouselRatio from '../../common/Carousel/index';
3+
import { StyledHeader, CarouselContainer } from './styles';
4+
5+
const Header = () => {
6+
return (
7+
<StyledHeader>
8+
<CarouselContainer>
9+
<CarouselRatio />
10+
</CarouselContainer>
11+
</StyledHeader>
12+
);
13+
};
14+
15+
export default Header;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Header.styles.js
2+
import { styled } from '@mui/material/styles';
3+
4+
export const StyledHeader = styled('header')(({ theme }) => ({
5+
width: '100%',
6+
height: '10%',
7+
display: 'flex',
8+
alignItems: 'center',
9+
justifyContent: 'center',
10+
backgroundColor: 'transparent',
11+
position: 'fixed', // fixa no topo
12+
top: 0,
13+
left: 0,
14+
zIndex: 100, // garante que fique acima de outros elementos
15+
padding: 0,
16+
margin: 0,
17+
}));
18+
19+
export const CarouselContainer = styled('div')(({ theme }) => ({
20+
width: '100%', // ocupa toda a largura disponível
21+
height: '100%', // altura total do header
22+
display: 'flex',
23+
alignItems: 'center',
24+
justifyContent: 'center',
25+
overflow: 'hidden', // esconde qualquer conteúdo que estourar
26+
}));
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from 'react';
2+
import { Outlet } from 'react-router-dom';
3+
import Header from './Header/index';
4+
import Footer from './Footer/index';
5+
import { Box } from '@mui/material';
6+
7+
const Layout = () => {
8+
return (
9+
<Box>
10+
<Header />
11+
<Box sx={{ minHeight: '80vh' }}>
12+
<Outlet />
13+
</Box>
14+
<Footer />
15+
</Box>
16+
);
17+
};
18+
19+
export default Layout;

0 commit comments

Comments
 (0)