--- template/app/src/landing-page/components/FeaturesGrid.tsx +++ opensaas-sh/app/src/landing-page/components/FeaturesGrid.tsx @@ -9,13 +9,15 @@ import { Feature } from "./Features"; import { SectionTitle } from "./SectionTitle"; -export interface GridFeature extends Omit { +export interface GridFeature extends Omit { + name?: string; icon?: React.ReactNode; emoji?: string; direction?: "col" | "row" | "col-reverse" | "row-reverse"; align?: "center" | "left"; size: "small" | "medium" | "large"; fullWidthIcon?: boolean; + highlight?: boolean; } interface FeaturesGridProps { @@ -59,7 +61,8 @@ direction = "col", align = "center", size = "medium", - fullWidthIcon = true, + fullWidthIcon = false, + highlight = false, }: GridFeature) { const gridFeatureSizeToClasses: Record = { small: "col-span-1", @@ -77,60 +80,98 @@ "col-reverse": "flex-col-reverse", }; + const mobileOrderClass = highlight ? "order-last md:order-none" : ""; + const gridFeatureCard = ( - + {fullWidthIcon && (icon || emoji) ? ( -
- {icon ? ( - icon - ) : emoji ? ( - {emoji} - ) : null} +
+
+ {icon ? ( +
{icon}
+ ) : emoji ? ( + {emoji} + ) : null} +
+ {fullWidthIcon && (icon || emoji) && ( + + {name} + + )} + + {description} +
) : (
-
- {icon ? ( - icon - ) : emoji ? ( - {emoji} - ) : null} -
+ {(icon || emoji) && ( +
+ {icon ? icon : {emoji}} +
+ )} {name}
)} - {fullWidthIcon && (icon || emoji) && ( - {name} + {!fullWidthIcon && ( + + {description} + )} - - {description} - ); @@ -141,7 +182,7 @@ href={href} target="_blank" rel="noopener noreferrer" - className={gridFeatureSizeToClasses[size]} + className={cn(gridFeatureSizeToClasses[size], mobileOrderClass)} > {gridFeatureCard}