Skip to content

Commit 22356af

Browse files
Merge pull request #111 from strudel-science/feature/showcase
Update the gallery detail page
2 parents 0993f47 + 6c1be0b commit 22356af

File tree

2 files changed

+39
-34
lines changed

2 files changed

+39
-34
lines changed

config/strudel-config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@
167167
"layoutComponent": "PageLayout"
168168
}
169169
]
170+
},
171+
{
172+
"name": "Gallery",
173+
"path": "/gallery"
170174
},
171175
{
172176
"name": "About",
@@ -192,10 +196,6 @@
192196
"layoutComponent": "PageLayout"
193197
}
194198
]
195-
},
196-
{
197-
"name": "Gallery",
198-
"path": "/gallery"
199199
}
200200
]
201201
}

src/components/layouts/GalleryDetailLayout.tsx

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -55,38 +55,43 @@ const GalleryDetailLayout: React.FC<PageProps<any, any>> = ({ pageContext, child
5555
>
5656
{pageContext.frontmatter.title}
5757
</Typography>
58-
<Typography fontSize="large">
59-
Contributed by {pageContext.frontmatter.contributors.join(', ')}
60-
</Typography>
58+
<Stack direction="row" spacing={2} alignItems="center">
59+
<Chip label={pageContext.frontmatter.appType} variant="outlined" />
60+
<Typography fontSize="large">
61+
Contributed by {pageContext.frontmatter.contributors.join(', ')}
62+
</Typography>
63+
</Stack>
6164
</Stack>
6265
</PageHeader>
6366
<Hero>
6467
<Stack spacing={2}>
65-
<Stack direction="row" spacing={2}>
66-
<Chip label={pageContext.frontmatter.appType} variant="outlined" sx={{ color: 'white' }} />
67-
{pageContext.frontmatter.liveUrl && (
68-
<MuiLink href={pageContext.frontmatter.liveUrl} target="_blank">
69-
<Button
70-
variant="contained"
71-
color="primary"
72-
startIcon={<VisibilityIcon />}
73-
>
74-
Go to Live Project
75-
</Button>
76-
</MuiLink>
77-
)}
78-
{pageContext.frontmatter.repoUrl && (
79-
<MuiLink href={pageContext.frontmatter.repoUrl} target="_blank">
80-
<Button
81-
variant="contained"
82-
color="primary"
83-
startIcon={<CodeIcon />}
84-
>
85-
Code
86-
</Button>
87-
</MuiLink>
88-
)}
89-
</Stack>
68+
{(pageContext.frontmatter.liveUrl || pageContext.frontmatter.repoUrl) && (
69+
<Stack direction="row" spacing={2}>
70+
{/* <Chip label={pageContext.frontmatter.appType} variant="outlined" sx={{ color: 'white' }} /> */}
71+
{pageContext.frontmatter.liveUrl && (
72+
<MuiLink href={pageContext.frontmatter.liveUrl} target="_blank">
73+
<Button
74+
variant="contained"
75+
color="primary"
76+
startIcon={<VisibilityIcon />}
77+
>
78+
Live Demo
79+
</Button>
80+
</MuiLink>
81+
)}
82+
{pageContext.frontmatter.repoUrl && (
83+
<MuiLink href={pageContext.frontmatter.repoUrl} target="_blank">
84+
<Button
85+
variant="contained"
86+
color="primary"
87+
startIcon={<CodeIcon />}
88+
>
89+
Code
90+
</Button>
91+
</MuiLink>
92+
)}
93+
</Stack>
94+
)}
9095
<StyledMarkdown>
9196
{children}
9297
</StyledMarkdown>
@@ -95,15 +100,15 @@ const GalleryDetailLayout: React.FC<PageProps<any, any>> = ({ pageContext, child
95100
<PageContainer maxWidth={containerWidth}>
96101
<PhotoProvider>
97102
<PhotoView src={primaryImage?.images.fallback?.src}>
98-
<ResponsiveImageWrapper>
103+
<ResponsiveImageWrapper sx={{ boxShadow: 3 }}>
99104
<img src={primaryImage?.images.fallback?.src} alt="Primary Gallery Image" />
100105
</ResponsiveImageWrapper>
101106
</PhotoView>
102107
<Grid container spacing={2} sx={{ marginTop: 2 }}>
103108
{otherImages.map((image: any, index: number) => (
104109
<Grid item xs={12} sm={6} key={index}>
105110
<PhotoView src={image?.images.fallback?.src}>
106-
<ResponsiveImageWrapper>
111+
<ResponsiveImageWrapper sx={{ boxShadow: 3 }}>
107112
<img
108113
src={image?.images.fallback?.src}
109114
alt={`Gallery Image ${index + 1}`}

0 commit comments

Comments
 (0)