Skip to content

Commit

Permalink
add SharedLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
MargoMarm committed Sep 14, 2023
1 parent 6dfdf09 commit ad514a5
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import { Route, Routes } from 'react-router-dom';
import { lazy } from 'react';

import SharedLayout from './components/SharedLayout/SharedLayout';
// import SharedLayout from './components/SharedLayout/SharedLayout';

const Home = lazy(() => import('../src/pages/Home/Home'));

const test = import.meta.env.VITE_API_TEST;

function App() {
// console.log(test);
// console.log(test);
return (
<Routes>
<Route path="/" element={<Home />} />
<Route path="/" element={<SharedLayout />}>
<Route index element={<Home />} />
</Route>
</Routes>
);
}
Expand Down
File renamed without changes.
Empty file added src/components/NavBar/.gitkeep
Empty file.
15 changes: 15 additions & 0 deletions src/components/SharedLayout/SharedLayout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Suspense } from 'react';
import { Outlet } from 'react-router-dom';
import { Container } from './SheradLayout.styled';

const SharedLayout = () => {
return (
<Container>
<Suspense fallback={null}>
<Outlet />
</Suspense>
</Container>
);
};

export default SharedLayout;
22 changes: 22 additions & 0 deletions src/components/SharedLayout/SheradLayout.styled.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import styled from '@emotion/styled';

import { mq } from '../../utils';

export const Container = styled.div`
margin: 0px auto;
padding: 0px 20px;
${mq.mobile} {
width: 375px;
}
${mq.tablet} {
width: 768px;
padding: 0px 32px;
}
${mq.desktop} {
width: 1440px;
padding: 0px 96px;
}
`;

0 comments on commit ad514a5

Please sign in to comment.