Skip to content

Commit 1751fd1

Browse files
committed
AppMenu and layout refactorings + first mobile layout version
1 parent 7927616 commit 1751fd1

File tree

7 files changed

+57
-16
lines changed

7 files changed

+57
-16
lines changed

src/common/components/IconButton/IconButton.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import classNames from "classnames";
22
import { forwardRef } from "react";
33

44
export type IconButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
5-
relevancy?: "primary" | "secondary";
5+
relevancy?: "primary" | "secondary" | 'ghost';
66
};
77

88
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
@@ -14,10 +14,11 @@ export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
1414
{...buttonProps}
1515
ref={ref}
1616
className={classNames(
17-
"size-8 rounded-full stroke-white text-white hover:bg-blue-500 active:bg-blue-600 place-content-center place-items-center flex outline-offset-2 shadow-md shadow-blue-400",
17+
"size-8 rounded-full hover:bg-blue-500 active:bg-blue-600 place-content-center place-items-center flex outline-offset-2 shadow-md shadow-blue-400",
1818
{
19-
"bg-blue-400": relevancy === "primary",
20-
"bg-stone-400": relevancy === "secondary",
19+
"bg-blue-400 stroke-white text-white shadow-md": relevancy === "primary",
20+
"bg-stone-200 stroke-blue-500 text-blue-500 shadow-md hover:stroke-white hover:text-white": relevancy === "secondary",
21+
"bg-transparent stroke-stone-500 text-stone-500 hover:stroke-white hover:text-white shadow-sm": relevancy === 'ghost',
2122
},
2223
)}
2324
>

src/container/AppMenu/AppMenu.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import logo from "@/assets/images/logo.png";
2+
import { IconButton } from "@/common/components/IconButton/IconButton";
3+
import { HomeIcon } from "@/assets/icons/HomeIcon";
4+
import { ListTodoIcon } from "@/assets/icons/ListTodoIcon";
5+
import { GraduationCapIcon } from "@/assets/icons/GraduationCapIcon";
6+
7+
export const AppMenu = () => {
8+
return (
9+
<div className="flex flex-row gap-4 place-items-center h-10">
10+
<IconButton
11+
type="button"
12+
onClick={() => console.log('yeah')}
13+
title="home"
14+
relevancy="secondary"
15+
>
16+
<HomeIcon />
17+
</IconButton>
18+
<IconButton
19+
type="button"
20+
onClick={() => console.log('yeah')}
21+
title="home"
22+
relevancy="secondary"
23+
>
24+
<ListTodoIcon />
25+
</IconButton>
26+
<IconButton
27+
type="button"
28+
onClick={() => console.log('yeah')}
29+
title="home"
30+
relevancy="secondary"
31+
>
32+
<GraduationCapIcon />
33+
</IconButton>
34+
</div>
35+
);
36+
};

src/container/PipInput/PipInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const PipInput = () => {
7171
type="button"
7272
onClick={renderPIP}
7373
title="detach"
74-
relevancy="secondary"
74+
relevancy="ghost"
7575
>
7676
<ArrowRightStartOnBox />
7777
</IconButton>

src/container/Settings/Settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export const Settings = () => {
189189
<IconButton
190190
type="button"
191191
aria-label="Open the settings"
192-
relevancy="secondary"
192+
relevancy="ghost"
193193
>
194194
<CogIcon />
195195
</IconButton>

src/container/TagEditor/TagEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const TagEditor = () => {
4747
<IconButton
4848
type="button"
4949
aria-label="Open the tag editor"
50-
relevancy="secondary"
50+
relevancy="ghost"
5151
>
5252
<TagIcon />
5353
</IconButton>

src/layouts/BaseLayout.astro

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ const { title } = Astro.props;
5151
(await isAuthenticated())
5252
) {
5353
document.body.classList.remove("hidden");
54+
document.body.classList.add("grid");
5455
} else {
5556
window.location.href = authUrl;
5657
}
5758
</script>
58-
<script>
59-
import "preline/dist/preline.js";
60-
</script>

src/pages/index.astro

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
import { AppMenu } from "@/container/AppMenu/AppMenu";
23
import { MainMenu } from "../container/MainMenu/MainMenu";
34
import { SearchInput } from "../container/SearchInput/SearchInput";
45
import { SparkInput } from "../container/SparkInput/SparkInput";
@@ -10,9 +11,9 @@ import Layout from "../layouts/BaseLayout.astro";
1011
<script src="../scripts/store/queryStore.ts"></script>
1112
<script src="../scripts/theme/initTheme.ts"></script>
1213
<Layout title="Sparktags">
13-
<main class="grid lg:grid-cols-[1fr_400px_600px_1fr] gap-6 h-full relative">
14+
<main class="px-2 md:px-0 grid md:grid-cols-[max-content_minmax(300px,_400px)_minmax(350px,_600px)] grid-cols-[min-content_minmax(auto,_600px)] md:grid-rows-[1fr] grid-rows-[max-content_max-content_max-content] md:gap-6 gap-2 h-full relative place-self-center">
1415
<div>
15-
<div class="py-10 flex flex-col place-items-end sticky top-0">
16+
<div class="md:py-10 pt-1 flex flex-col place-items-end sticky top-0">
1617
<!-- We need an h1 for accessibility reasons -->
1718
<h1 class="sr-only">Dashboard</h1>
1819
<MainMenu client:only="react" />
@@ -21,20 +22,25 @@ import Layout from "../layouts/BaseLayout.astro";
2122
<!-- the following div is needed for the sticky aside to work -->
2223
<div>
2324
<aside
24-
class="py-10 grid grid-rows-[200px_1fr_100px] max-h-screen h-screen sticky top-0"
25+
class="md:py-10 pt-1 grid grid-rows-[max-content_max-content_max-content_0px] md:grid-rows-[max-content_200px_1fr_max-content] gap-4 md:max-h-screen md:h-screen sticky top-0"
2526
>
27+
<div>
28+
<AppMenu />
29+
</div>
2630
<SparkInput client:only="react" />
2731
<div>
2832
<SearchInput client:only="react" />
2933
</div>
30-
<div>
34+
<div class="hidden md:block">
3135
3236
</div>
3337
</aside>
3438
</div>
35-
<section>
39+
<section class="col-span-2 md:col-span-1">
3640
<SparkList client:only="react" />
3741
</section>
38-
<div></div>
42+
<div class="block md:hidden col-span-2 md:col-span-1">
43+
44+
</div>
3945
</main>
4046
</Layout>

0 commit comments

Comments
 (0)