From aaad3994a1158eb0e7ad02209f47202b09edc25a Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Nov 2022 17:10:46 +0100 Subject: [PATCH] feat: Add banner to dataset browse page --- app/configurator/components/presence.tsx | 7 ++ .../components/select-dataset-step.tsx | 107 ++++++++++-------- 2 files changed, 68 insertions(+), 46 deletions(-) diff --git a/app/configurator/components/presence.tsx b/app/configurator/components/presence.tsx index 1055b559ff..7181c002ec 100644 --- a/app/configurator/components/presence.tsx +++ b/app/configurator/components/presence.tsx @@ -35,3 +35,10 @@ export const navPresenceProps = { animate: "center", exit: "exit", }; + +export const bannerPresenceProps = { + transition: { duration: 0.5 }, + initial: { scaleY: 0, marginTop: -350 }, + animate: { scaleY: 1, marginTop: 0 }, + exit: { scaleY: 0, marginTop: -350 }, +}; diff --git a/app/configurator/components/select-dataset-step.tsx b/app/configurator/components/select-dataset-step.tsx index b3155975a6..1167c8ebac 100644 --- a/app/configurator/components/select-dataset-step.tsx +++ b/app/configurator/components/select-dataset-step.tsx @@ -1,5 +1,5 @@ import { t, Trans } from "@lingui/macro"; -import { Box, Button, Typography } from "@mui/material"; +import { Box, Button, Theme, Typography } from "@mui/material"; import { makeStyles } from "@mui/styles"; import { AnimatePresence } from "framer-motion"; import Head from "next/head"; @@ -21,11 +21,13 @@ import { import { DataSetMetadata } from "@/configurator/components/dataset-metadata"; import { DataSetPreview } from "@/configurator/components/dataset-preview"; import { + PanelBannerWrapper, PanelLayout, PanelLeftWrapper, PanelMiddleWrapper, } from "@/configurator/components/layout"; import { + bannerPresenceProps, MotionBox, navPresenceProps, } from "@/configurator/components/presence"; @@ -43,31 +45,49 @@ const softJSONParse = (v: string) => { } }; -const useStyles = makeStyles(() => ({ +const useStyles = makeStyles((theme) => ({ panelLayout: { width: "100%", - maxWidth: 1300, margin: "auto", left: 0, right: 0, position: "static", // FIXME replace 96px with actual header size - marginTop: "96px", + marginTop: 96, height: "auto", - paddingTop: "55px", }, panelLeft: { backgroundColor: "transparent", - paddingTop: 0, + paddingTop: 24, boxShadow: "none", borderRight: 0, }, panelMiddle: { - paddingTop: 0, + paddingTop: 24, paddingLeft: 18, gridColumnStart: "middle", gridColumnEnd: "right", }, + panelBanner: { + display: "grid", + gridTemplateColumns: + "minmax(12rem, 20rem) minmax(22rem, 1fr) minmax(12rem, 20rem)", + gridTemplateAreas: `". content ."`, + }, + panelBannerContent: { + display: "flex", + flexDirection: "column", + justifyContent: "center", + gridArea: "content", + }, + panelBannerTitle: { + color: theme.palette.grey[700], + marginBottom: theme.spacing(4), + }, + panelBannerDescription: { + color: theme.palette.grey[600], + marginBottom: theme.spacing(3), + }, })); export const formatBackLink = ( @@ -160,6 +180,39 @@ const SelectDatasetStepContent = () => { )} + + {!dataset && ( + + + + + Visualize Swiss Open Government Data + + + + Explore datasets provided by the LINDAS Linked Data Service + by either filtering by categories or organisations or search + directly for specific keywords. Click on a dataset to see + more detailed information and start creating your own + visualizations. + + + + + + + )} + @@ -172,7 +225,7 @@ const SelectDatasetStepContent = () => { ) : ( - {filters.length > 0 ? ( + {filters.length > 0 && ( { .map((f) => f.label) .join(", ")} - ) : ( - <> - - - All datasets - - - - - Explore datasets provided by the LINDAS Linked Data - Service by either filtering by categories or - organisations or search directly for specific keywords. - Click on a dataset to see more detailed information and - start creating your own visualizations. - - - )} - - - )}