diff --git a/frontend/src/components/pages/home/Home.tsx b/frontend/src/components/pages/home/Home.tsx index 35c593b36..c1d28bdc5 100644 --- a/frontend/src/components/pages/home/Home.tsx +++ b/frontend/src/components/pages/home/Home.tsx @@ -56,10 +56,12 @@ const HomeUI: React.FC = () => { .filter(({ results }) => results.length > 0) .map(({ titleTranslationId, iconUrl, results }) => ( ))} {homeBottom !== undefined && ( diff --git a/frontend/src/components/pages/home/components/HomeSection/HomeSection.tsx b/frontend/src/components/pages/home/components/HomeSection/HomeSection.tsx index a8912fd39..b7e169405 100644 --- a/frontend/src/components/pages/home/components/HomeSection/HomeSection.tsx +++ b/frontend/src/components/pages/home/components/HomeSection/HomeSection.tsx @@ -3,34 +3,45 @@ import { ResultCard } from 'components/pages/search/components/ResultCard'; import { getHoverId } from 'components/pages/search/utils'; import { ActivitySuggestion } from 'modules/activitySuggestions/interface'; import SVG from 'react-inlinesvg'; -import styled from 'styled-components'; +import { cn } from 'services/utils/cn'; import { optimizeAndDefineColor } from 'stylesheet'; export interface HomeSectionProps { title: string; iconUrl: string; results: ActivitySuggestion['results']; + className?: string; + asColumn?: boolean; } -export const HomeSection: React.FC = ({ title, iconUrl, results }) => { +export const HomeSection: React.FC = ({ + asColumn = false, + title, + iconUrl, + results, + className, +}) => { return ( -
-

- - {title} -

- +
+ {title && ( +

+ + {title} +

+ )} +
{results.map(e => { return ( = ({ title, iconUrl, result badgeName={e.category?.label} informations={e.informations} redirectionUrl={generateDetailsUrlFromType(e.type, e.id, e.name)} - className="my-4 desktop:my-6 desktop:mx-1" // Height is not limited to let the card grow with long text & informations. Most photos are not vertical, and does not have to be restrained. + className="my-4 desktop:my-6 desktop:mx-1 min-w-70 max-w-70 desktop:max-w-none shrink-0" /> ); })} - +
); }; - -const ScrollContainer = styled.div` - @media (max-width: 1024px) { - & > * { - flex: auto; - max-width: 300px; - min-width: 300px; - margin-right: 20px; - } - } -`;