From 3e1e84ee5ea400df94f73c1aea4c3eb61d7cbb8f Mon Sep 17 00:00:00 2001 From: James Grugett Date: Tue, 30 Aug 2022 17:14:22 -0500 Subject: [PATCH] Experimental Home: Add links. Single layer carousel for < 6 cards --- web/pages/experimental/home.tsx | 81 ++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/web/pages/experimental/home.tsx b/web/pages/experimental/home.tsx index a2d47609..887cb4c6 100644 --- a/web/pages/experimental/home.tsx +++ b/web/pages/experimental/home.tsx @@ -14,16 +14,16 @@ import { useSaveReferral } from 'web/hooks/use-save-referral' import { GetServerSideProps } from 'next' import { Sort } from 'web/components/contract-search' import { Button } from 'web/components/button' -import { Spacer } from 'web/components/layout/spacer' import { useMemberGroups } from 'web/hooks/use-group' import { Group } from 'common/group' import { Carousel } from 'web/components/carousel' import { LoadingIndicator } from 'web/components/loading-indicator' import { ContractCard } from 'web/components/contract/contract-card' import { range } from 'lodash' -import { Subtitle } from 'web/components/subtitle' import { Contract } from 'common/contract' import { ShowTime } from 'web/components/contract/contract-details' +import { GroupLinkItem } from '../groups' +import { SiteLink } from 'web/components/site-link' export const getServerSideProps: GetServerSideProps = async (ctx) => { const creds = await authenticateOnServer(ctx) @@ -44,7 +44,7 @@ const Home = (props: { auth: { user: User } | null }) => { return ( - + @@ -72,10 +72,13 @@ function SearchSection(props: { sort: Sort }) { const { label, user, sort } = props + const href = `/home?s=${sort}` return ( - + + {label} + ) : ( @@ -100,9 +108,8 @@ function GroupSection(props: { group: Group; user: User | null }) { const { group, user } = props return ( - - - + +
- {contracts && - range(0, Math.floor(contracts.length / 2)).map((col) => { - const i = col * 2 - return ( - - - - - ) - })} + {contracts.length >= 6 + ? range(0, Math.floor(contracts.length / 2)).map((col) => { + const i = col * 2 + return ( + + + + + ) + }) + : contracts.map((c) => ( + + ))}