Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions gl-core/cartridges/DesignSystem/components/StandardCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ export function StandardCard({
const [expanded, setExpanded] = React.useState(false);
const isMobile = useIsMobile();

function stripShortcodes(str: string | undefined) {
if (!str) return '';
return str.replace(/\[[^\]]*\]/g, '').trim();
}

if (!content) return null;

const { title, description, image, icon } = content;

// Shared image height for consistency
const MEDIA_HEIGHT = 200;

return (
<Card
sx={{
Expand Down Expand Up @@ -91,15 +89,15 @@ export function StandardCard({
}}
/>

{/* Desktop-only thumbnail when collapsed */}
{/* Thumbnail when collapsed */}
{thumbnails && image && !expanded && !isMobile && (
<CardMedia
component="img"
image={image}
alt={title}
sx={{
width: '100%',
height: 180,
height: MEDIA_HEIGHT,
objectFit: 'cover',
borderRadius: 0,
}}
Expand All @@ -108,17 +106,23 @@ export function StandardCard({

<Collapse in={expanded} timeout="auto" unmountOnExit>
<CardContent>
{/* On mobile, show the image only inside the expanded section */}
{/* Expanded image — same height as thumbnail */}
{image && (
<CardMedia
component="img"
image={image}
alt={title}
sx={{ borderRadius: 2, mb: 1, objectFit: 'cover' }}
sx={{
borderRadius: 2,
mb: 1,
width: '100%',
height: MEDIA_HEIGHT,
objectFit: 'cover',
}}
/>
)}

<Typography variant="body1" sx={{}}>
<Typography variant="body1">
{description}
</Typography>
</CardContent>
Expand Down
1 change: 0 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const withPWA = require('next-pwa')({
const nextConfig = {
devIndicators: false,
transpilePackages: ['react-map-gl', 'mapbox-gl'],

images: {
remotePatterns: [
{
Expand Down