Skip to content

Commit 0df353b

Browse files
committed
client(Main.tsx) add a new wrapper component
1 parent e2d9fb0 commit 0df353b

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

client/src/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useState } from "react";
2+
import Main from "./components/layout/Main";
23
import Header from "./pages/Header";
34
import Options from "./pages/Options";
45
import Preview from "./pages/Preview";
@@ -12,10 +13,10 @@ const App = () => {
1213
<div className="bg-gh-bg w-full min-h-screen overflow-x-hidden select-none pb-5">
1314
<Header />
1415

15-
<main className="flex gap-4 mx-4 sm:mx-10 md:mx-32 lg:mx-36 mt-6 flex-col lg:flex-row">
16+
<Main>
1617
<Options setLink={(link: string) => setLink(link)} />
1718
<Preview link={link} />
18-
</main>
19+
</Main>
1920
</div>
2021
);
2122
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { FC, ReactElement } from "react";
2+
3+
interface MainProps {
4+
children: ReactElement[];
5+
}
6+
7+
const Main: FC<MainProps> = ({ children }) => {
8+
return (
9+
<main className="flex gap-4 mx-4 sm:mx-10 md:mx-32 lg:mx-36 mt-6 flex-col lg:flex-row">
10+
{children}
11+
</main>
12+
);
13+
};
14+
15+
export default Main;

0 commit comments

Comments
 (0)