File tree 10 files changed +400
-31
lines changed
10 files changed +400
-31
lines changed Original file line number Diff line number Diff line change 3
3
"version" : " 0.1.0" ,
4
4
"private" : true ,
5
5
"dependencies" : {
6
- "@emotion/react" : " ^11.11.0 " ,
6
+ "@emotion/react" : " ^11.13.5 " ,
7
7
"@emotion/styled" : " ^11.11.0" ,
8
8
"@mui/icons-material" : " ^5.11.16" ,
9
+ "@mui/joy" : " ^5.0.0-beta.48" ,
9
10
"@mui/material" : " ^5.13.0" ,
10
11
"@testing-library/jest-dom" : " ^5.16.5" ,
11
12
"@testing-library/react" : " ^13.4.0" ,
Original file line number Diff line number Diff line change @@ -2,27 +2,32 @@ import React from 'react';
2
2
import { createBrowserRouter , RouterProvider } from 'react-router-dom' ;
3
3
import StockPortfolio from './pages/StockPortfolio' ;
4
4
import HelloWorldPage from './pages/HelloWorldPage' ;
5
+ import Layout from './components/Layout/index' ;
5
6
6
7
const router = createBrowserRouter ( [
7
8
{
8
9
path : "/" ,
9
- element : < StockPortfolio /> ,
10
+ element : < Layout /> ,
10
11
children : [
12
+ {
13
+ path : "" ,
14
+ element : < StockPortfolio /> ,
15
+ } ,
11
16
{
12
17
path : "hello" ,
13
- element : < HelloWorldPage />
14
- }
15
- ]
16
- }
18
+ element : < HelloWorldPage /> ,
19
+ } ,
20
+ ] ,
21
+ } ,
17
22
] , {
18
23
future : {
19
24
v7_startTransition : true ,
20
- v7_relativeSplatPath : true
25
+ v7_relativeSplatPath : true ,
21
26
}
22
27
} ) ;
23
28
24
29
function App ( ) {
25
30
return < RouterProvider router = { router } /> ;
26
31
}
27
32
28
- export default App ;
33
+ export default App ;
Original file line number Diff line number Diff line change
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 number Diff line number Diff line change
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 number Diff line number Diff line change
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 number Diff line number Diff line change
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
+ } ) ) ;
Original file line number Diff line number Diff line change
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 ;
You can’t perform that action at this time.
0 commit comments