Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: header and sidebar data passing logic #521

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions apps/ui-desktop/src/App.css

This file was deleted.

14 changes: 3 additions & 11 deletions apps/ui-desktop/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "./App.css";
import "@codepod/ui/src/App.css";
import "@codepod/ui/src/custom.css";

import {
Expand Down Expand Up @@ -40,18 +40,10 @@ const theme = createTheme({
},
});

type NormalLayoutProps = {
currentPage?: string | null;
children: React.ReactNode;
};

const NormalLayout: React.FC<NormalLayoutProps> = ({
currentPage,
children,
}) => {
const NormalLayout = ({ children }) => {
return (
<Box>
<Header currentPage={currentPage} />
<Header />
<Box pt="50px">{children}</Box>
{/* <Footer /> */}
</Box>
Expand Down
89 changes: 0 additions & 89 deletions apps/ui-desktop/src/index.css

This file was deleted.

14 changes: 7 additions & 7 deletions apps/ui-desktop/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "@codepod/ui/src/index.css";

ReactDOM.createRoot(document.getElementById('root')!).render(
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
</React.StrictMode>
);
42 changes: 0 additions & 42 deletions apps/ui-web/src/App.css

This file was deleted.

21 changes: 8 additions & 13 deletions apps/ui-web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "./App.css";
import "@codepod/ui/src/App.css";
import "@codepod/ui/src/custom.css";

import {
Expand Down Expand Up @@ -48,18 +48,10 @@ const theme = createTheme({
},
});

type NormalLayoutProps = {
currentPage?: string | null;
children: React.ReactNode;
};

const NormalLayout: React.FC<NormalLayoutProps> = ({
currentPage,
children,
}) => {
const NormalLayout = ({ children }) => {
return (
<Box>
<Header currentPage={currentPage} />
<Header />
<Box pt="50px">{children}</Box>
{/* <Footer /> */}
</Box>
Expand All @@ -78,14 +70,17 @@ const router = createBrowserRouter([
{
path: "dashboard",
element: (
<NormalLayout currentPage="Dashboard">
<NormalLayout>
<Dashboard />
</NormalLayout>
),
},
{
path: "repo/:id",
element: (
// Not wrapperd with NormalLayout (header + padding) because:
// 1. Need to use vh to make the Canvas exact full screen
// 2. Need to populate more buttons to header.
<Box height="100vh" width="100%" boxSizing={"border-box"}>
<Repo yjsWsUrl={yjsWsUrl} />
</Box>
Expand All @@ -110,7 +105,7 @@ const router = createBrowserRouter([
{
path: "profile",
element: (
<NormalLayout currentPage="Profile">
<NormalLayout>
<Profile />
</NormalLayout>
),
Expand Down
89 changes: 0 additions & 89 deletions apps/ui-web/src/index.css

This file was deleted.

14 changes: 7 additions & 7 deletions apps/ui-web/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "@codepod/ui/src/index.css";

ReactDOM.createRoot(document.getElementById('root')!).render(
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
</React.StrictMode>
);
2 changes: 1 addition & 1 deletion apps/ui/src/App.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#root {
max-width: 1280px;
/* max-width: 1280px; */
margin: 0 auto;
/* padding: 2rem; */
/* text-align: center; */
Expand Down
Loading