Skip to content

Commit

Permalink
feat: add minimal layout
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Feb 1, 2022
1 parent 4cee0a2 commit 2f4b5d5
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import { getUser } from "./api/auth";
import { AuthContext } from "./context";
import { Loading } from "./components/Loading";
import { Toast, ToastContext, ToastProvider } from "./components/Toast/toast";
import { Toast, ToastContext } from "./components/Toast/toast";

export const navigation = [
{
Expand Down
3 changes: 2 additions & 1 deletion src/components/Layout/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { SearchLayout } from "./search";
import { MinimalLayout } from "./minimal";
import SidebarLayout from "./sidebar";

export { SearchLayout, SidebarLayout };
export { SearchLayout, SidebarLayout, MinimalLayout };
26 changes: 26 additions & 0 deletions src/components/Layout/minimal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { UserProfile } from "../UserProfile/user-profile";

export function MinimalLayout({ children, title }) {
return (
<div>
<div className="md:pl-64 flex flex-col flex-1">
<div className="sticky top-0 z-10 flex-shrink-0 flex h-16 bg-white shadow">
<div className="flex-1 px-4 flex justify-between">
<div className="flex items-center">
<div>{title}</div>
</div>
<div className="ml-4 flex items-center md:ml-6">
<UserProfile />
</div>
</div>
</div>

<main>
<div className="py-6 max-w-screen-lg mx-auto">
<div className="mx-auto px-4 sm:px-6 md:px-8">{children}</div>
</div>
</main>
</div>
</div>
);
}
10 changes: 10 additions & 0 deletions src/pages/incident/incident-create.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { IncidentCreate } from "../../components/Incidents/IncidentCreate";
import { MinimalLayout } from "../../components/Layout";

export function IncidentCreatePage() {
return (
<MinimalLayout title="Create Incident">
<IncidentCreate />
</MinimalLayout>
);
}
8 changes: 4 additions & 4 deletions src/pages/incident/incident-list.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import { getAllIncident } from "../../../api/services/incident";
import { IncidentCreate } from "../../../components/Incidents/IncidentCreate";
import { IncidentList } from "../../../components/Incidents/IncidentList";
import { Modal } from "../../../components/Modal";
import { getAllIncident } from "../../api/services/incident";
import { IncidentCreate } from "../../components/Incidents/IncidentCreate";
import { IncidentList } from "../../components/Incidents/IncidentList";
import { Modal } from "../../components/Modal";

export function IncidentListPage() {
const navigate = useNavigate();
Expand Down
9 changes: 8 additions & 1 deletion src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { IncidentDetailsPage } from "./incident/incident-details";
import { IncidentListPage } from "./incident/incident-list";
import { IncidentCreatePage } from "./incident/incident-create";
import { LogsPage } from "./logs-page";
import { TopologyPage } from "./topology-page";

export { LogsPage, TopologyPage, IncidentDetailsPage, IncidentListPage };
export {
LogsPage,
TopologyPage,
IncidentDetailsPage,
IncidentListPage,
IncidentCreatePage
};

0 comments on commit 2f4b5d5

Please sign in to comment.