From ad28be86723defb411901bc36ccb78ce24db4883 Mon Sep 17 00:00:00 2001 From: Felicitas Pojtinger Date: Sat, 11 Feb 2023 23:45:57 +0100 Subject: [PATCH] feat: Add page view --- app/globals.scss | 36 +++++++++++++++++++++++++----------- components/home.tsx | 32 +++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 12 deletions(-) diff --git a/app/globals.scss b/app/globals.scss index 3aa5391..1df5b5c 100644 --- a/app/globals.scss +++ b/app/globals.scss @@ -144,10 +144,14 @@ $color--substance-use: #ff7e74; .pf-x-c-grid { --pf-l-grid--m-gutter--GridGap: 0.5rem; - flex: 1; - --pf-l-grid__item--GridColumnEnd: span 1 !important; - grid-template-columns: repeat(1, [col-start] 1fr) !important; + &--week, + &--month { + --pf-l-grid__item--GridColumnEnd: span 1 !important; + grid-template-columns: repeat(1, [col-start] 1fr) !important; + + flex: 1; + } &__header { margin-top: var(--pf-global--spacer--md) !important; @@ -167,14 +171,17 @@ $color--substance-use: #ff7e74; grid-template-columns: repeat(4, [col-start] 1fr) !important; } - & .pf-l-grid__item { - padding-left: var(--pf-global--spacer--sm) !important; - padding-right: var(--pf-global--spacer--sm) !important; - - &:not(:first-child) { - border-width: 0 0 0 1px; - border-style: dashed; - border-color: var(--pf-global--Color--400); + &--week, + &--month { + & .pf-l-grid__item { + padding-left: var(--pf-global--spacer--sm) !important; + padding-right: var(--pf-global--spacer--sm) !important; + + &:not(:first-child) { + border-width: 0 0 0 1px; + border-style: dashed; + border-color: var(--pf-global--Color--400); + } } } @@ -184,6 +191,13 @@ $color--substance-use: #ff7e74; } } +.pf-x-c-page { + flex: 1; + display: flex; + justify-content: center; + align-items: center; +} + .pf-c-card--preview { &:not(:first-child) { @extend .pf-u-mt-sm; diff --git a/components/home.tsx b/components/home.tsx index d69e575..a91032e 100644 --- a/components/home.tsx +++ b/components/home.tsx @@ -699,7 +699,7 @@ export default function Home() { {[ { value: "week", label: "Week" }, { value: "month", label: "Month" }, - { value: "list", label: "List" }, + { value: "page", label: "Page" }, ].map((el, i) => ( )} + {scale === "page" && ( +
+ + {ENTRIES.map((v, id) => ({ id, ...v })) + .filter( + (e) => + activeTopics.filter((v) => e.topics.includes(v)) + .length > 0 + ) + .slice(0, 4) + .map((entry) => ( + + + setSelectedEntryIndex((e) => + e === entry.id ? -1 : entry.id + ) + } + showDate + showDay + /> + + ))} + +
+ )} +