refactor: moving dock and topbar together with app wrapper
This commit is contained in:
19
frontend/src/components/app-wrapper/dock.tsx
Normal file
19
frontend/src/components/app-wrapper/dock.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { A } from "@solidjs/router";
|
||||
import { IconHome, IconPhoto, IconSearch } from "@tabler/icons-solidjs";
|
||||
import { Component } from "solid-js";
|
||||
|
||||
export const Dock: Component = () => {
|
||||
return (
|
||||
<div class="w-full mt-auto h-16 bg-white flex justify-between m-4 rounded-xl">
|
||||
<A href="/" class="w-full flex justify-center items-center">
|
||||
<IconHome />
|
||||
</A>
|
||||
<A href="/" class="w-full flex justify-center items-center">
|
||||
<IconSearch />
|
||||
</A>
|
||||
<A href="/" class="w-full flex justify-center items-center">
|
||||
<IconPhoto />
|
||||
</A>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,7 +1,15 @@
|
||||
import { Component, ParentProps } from "solid-js";
|
||||
import { Topbar } from "./topbar";
|
||||
import { Dock } from "./dock";
|
||||
|
||||
export const AppWrapper: Component<ParentProps> = (props) => {
|
||||
return (
|
||||
<div class="flex w-full justify-center h-screen">{props.children}</div>
|
||||
<div class="w-full flex flex-col items-center h-screen">
|
||||
<div class="container flex flex-col w-full h-full">
|
||||
<Topbar />
|
||||
{props.children}
|
||||
<Dock />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
16
frontend/src/components/app-wrapper/topbar.tsx
Normal file
16
frontend/src/components/app-wrapper/topbar.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { useNavigate } from "@solidjs/router";
|
||||
import { IconArrowLeft } from "@tabler/icons-solidjs";
|
||||
import { Component } from "solid-js";
|
||||
|
||||
export const Topbar: Component = () => {
|
||||
const nav = useNavigate();
|
||||
|
||||
return (
|
||||
<div class="w-full flex items-center bg-white rounded-xl h-16">
|
||||
<div class="cursor-pointer" onClick={() => nav(-1)}>
|
||||
<IconArrowLeft />
|
||||
</div>
|
||||
<h1 class="font-bold text-2xl">Haystack</h1>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,33 +0,0 @@
|
||||
import { A, useNavigate } from "@solidjs/router";
|
||||
import {
|
||||
IconArrowLeft,
|
||||
IconHome,
|
||||
IconPhoto,
|
||||
IconSearch,
|
||||
} from "@tabler/icons-solidjs";
|
||||
import { Component, ParentProps } from "solid-js";
|
||||
|
||||
export const WithDock: Component<ParentProps> = (props) => {
|
||||
const nav = useNavigate();
|
||||
|
||||
return (
|
||||
<div class="w-full flex flex-col items-center">
|
||||
{/* TODO: this should only show up when NOT on the home page. */}
|
||||
<div class="cursor-pointer" onClick={() => nav(-1)}>
|
||||
<IconArrowLeft />
|
||||
</div>
|
||||
{props.children}
|
||||
<div class="w-full mt-auto h-16 bg-white flex justify-between m-4 rounded-xl">
|
||||
<A href="/" class="w-full flex justify-center items-center">
|
||||
<IconHome />
|
||||
</A>
|
||||
<A href="/" class="w-full flex justify-center items-center">
|
||||
<IconSearch />
|
||||
</A>
|
||||
<A href="/" class="w-full flex justify-center items-center">
|
||||
<IconPhoto />
|
||||
</A>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user