Skip to content

Commit

Permalink
Refactor layout and add host command
Browse files Browse the repository at this point in the history
  • Loading branch information
gvorbeck committed Jan 22, 2024
1 parent b382704 commit 7f122bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
5 changes: 1 addition & 4 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<!doctype html>
<html
lang="en"
class="h-full [&_body]:h-full [&_#root]:h-full [&_#root>div]:h-full [&_#root>div]:overflow-auto"
>
<html lang="en" class="[&_#root>div]:overflow-auto">
<head>
<meta charset="UTF-8" />
<link
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"format": "prettier --write './src/**/*.{js,ts,tsx}'",
"test": "jest"
"test": "jest",
"host": "vite --host"
},
"dependencies": {
"@ant-design/icons": "^5.2.6",
Expand Down
10 changes: 3 additions & 7 deletions src/components/PageLayout/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@ interface PageLayoutProps {

const PageLayout: React.FC<PageLayoutProps> = ({ user }) => {
const contentWidthClassName = "max-w-[1200px] mx-auto w-full";
const layoutContentClassName = classNames(
contentWidthClassName,
"p-4",
"flex-[1_0_auto]",
);
const layoutContentClassName = classNames(contentWidthClassName, "p-4");
const location = useLocation();
const isHomePage = location.pathname === "/";
const navigate = useNavigate();
return (
<Layout className="bg-noise flex flex-col">
<Layout className="flex flex-col min-h-[100vh]">
<Layout.Header className="flex items-center">
<PageHeader user={user} className={contentWidthClassName} />
</Layout.Header>
Expand Down Expand Up @@ -61,7 +57,7 @@ const PageLayout: React.FC<PageLayoutProps> = ({ user }) => {
<Outlet context={{ user, className: "" }} />
</Flex>
</Layout.Content>
<Layout.Footer className="shrink-0">
<Layout.Footer>
<PageFooter className={contentWidthClassName} />
</Layout.Footer>
</Layout>
Expand Down

0 comments on commit 7f122bd

Please sign in to comment.