Skip to content

Commit

Permalink
Update page.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
versceana authored Mar 3, 2024
1 parent 5a2d7e9 commit 075a6b6
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ import {
import Link from "next/link";
import React from "react";
import { useIsClient, useWindowSize } from "usehooks-ts";
import { useState } from "react";

export default function Page() {
const { width } = useWindowSize();
const isClient = useIsClient();
const { data: user } = useUsersGetMe();
const favorites = user?.favorites_association || [];
const { musicRoomSchedule } = useMyMusicRoom();
const [isAvailable, setIsAvailable] = useState(true);

if (!isClient) {
return <></>;
Expand Down Expand Up @@ -53,9 +55,10 @@ export default function Page() {
</div>
</div>
<div className="flex flex-col justify-between gap-4 @container/sections @6xl/content:flex-row @6xl/content:gap-8">
<div className="flex w-full flex-col @container/schedule @6xl/content:w-1/2">
<h2 className="my-4 text-3xl font-medium">Schedule</h2>
{favorites.filter((v) => v.predefined === true).length === 0 ? (
<details className="flex w-full flex-col @container/schedule @6xl/content:w-1/2">
<summary className="my-4 text-3xl font-medium">Schedule</summary>
{!isAvailable ? null :
favorites.filter((v) => v.predefined === true).length === 0 ? (
<p className="mb-4 text-lg text-text-secondary/75">Nothing here.</p>
) : (
<div className="grid grid-cols-1 justify-stretch gap-4 @lg/schedule:grid-cols-2 @4xl/schedule:grid-cols-3">
Expand Down Expand Up @@ -86,10 +89,11 @@ export default function Page() {
)}
</div>
)}
</div>
<div className="flex w-full flex-col @container/favorites @6xl/content:w-1/2">
<h2 className="my-4 text-3xl font-medium">Favorites</h2>
{favorites.filter((v) => v.predefined === false).length === 0 ? (
</details>
<details className="flex w-full flex-col @container/favorites @6xl/content:w-1/2">
<summary className="my-4 text-3xl font-medium">Favorites</summary>
{!isAvailable ? null :
favorites.filter((v) => v.predefined === false).length === 0 ? (
<p className="mb-4 text-lg text-text-secondary/75">
Add favorite calendars using star button.
<br />
Expand All @@ -110,7 +114,7 @@ export default function Page() {
))}
</div>
)}
</div>
</details>
</div>
<h2 className="my-4 text-3xl font-medium">Your calendar</h2>
<div className="@lg/content:-mx-8 @lg/content:-mb-8">
Expand Down

0 comments on commit 075a6b6

Please sign in to comment.