Skip to content

Commit ac3e6d4

Browse files
Merge pull request #50 from Azure-Samples/mirza/fe/hotifix-ctas
Improve ShowcaseCard and ShowcaseListTile styles for layout consistency
2 parents 3a80a0f + 3d4a7fc commit ac3e6d4

4 files changed

Lines changed: 93 additions & 46 deletions

File tree

src/components/gallery/ShowcaseCard/index.tsx

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -125,47 +125,49 @@ function ShowcaseCard({
125125
{tileNumber !== undefined && (
126126
<div className={styleCSS.mobileTileNumber}>{tileNumber}</div>
127127
)}
128-
{user.image && (
129-
<div className={styleCSS.imageContainer}>
130-
<OptimizedImage
131-
src={user.image}
132-
alt={displayTitle + " image"}
133-
objectFit="cover"
134-
style={{
135-
width: "100%",
136-
height: "200px",
137-
display: "block",
138-
borderRadius: "8px 8px 0px 0px",
139-
}}
128+
<div className={styleCSS.cardContent}>
129+
{user.image && (
130+
<div className={styleCSS.imageContainer}>
131+
<OptimizedImage
132+
src={user.image}
133+
alt={displayTitle + " image"}
134+
objectFit="cover"
135+
style={{
136+
width: "100%",
137+
height: "200px",
138+
display: "block",
139+
borderRadius: "8px 8px 0px 0px",
140+
}}
141+
/>
142+
</div>
143+
)}
144+
<div className={styleCSS.cardTags}>
145+
<ShowcaseCardTag
146+
key={displayTitle}
147+
tags={tags}
148+
cardPanel={false}
149+
buttonText={buttonText}
140150
/>
141151
</div>
142-
)}
143-
<div className={styleCSS.cardTags}>
144-
<ShowcaseCardTag
145-
key={displayTitle}
146-
tags={tags}
147-
cardPanel={false}
148-
buttonText={buttonText}
149-
/>
150-
</div>
151-
<div style={{ padding: 16 }}>
152-
{coverPage ? (
153-
<>
154-
<div className={styleCSS.cardTitleCoverPage}>
155-
{displayTitle}
156-
</div>
157-
<div className={styleCSS.cardDescriptionCoverPage}>
158-
{displayDescription}
159-
</div>
160-
</>
161-
) : (
162-
<>
163-
<div className={styleCSS.cardTitle}>{displayTitle}</div>
164-
<div className={styleCSS.cardDescription}>
165-
{displayDescription}
166-
</div>
167-
</>
168-
)}
152+
<div style={{ padding: 16 }}>
153+
{coverPage ? (
154+
<>
155+
<div className={styleCSS.cardTitleCoverPage}>
156+
{displayTitle}
157+
</div>
158+
<div className={styleCSS.cardDescriptionCoverPage}>
159+
{displayDescription}
160+
</div>
161+
</>
162+
) : (
163+
<>
164+
<div className={styleCSS.cardTitle}>{displayTitle}</div>
165+
<div className={styleCSS.cardDescription}>
166+
{displayDescription}
167+
</div>
168+
</>
169+
)}
170+
</div>
169171
</div>
170172
{/* <CardFooter> */}
171173
{user.website && (
@@ -178,6 +180,7 @@ function ShowcaseCard({
178180
onClick={(e) => e.stopPropagation()}
179181
style={{
180182
width: "100%",
183+
marginTop: "-1px",
181184
fontSize: "14px",
182185
fontWeight: 600,
183186
display: "flex",
@@ -186,6 +189,7 @@ function ShowcaseCard({
186189
paddingLeft: "16px",
187190
paddingRight: "16px",
188191
...ctaStyles,
192+
borderRadius: "3px 3px 16px 16px",
189193
}}
190194
>
191195
<span>{buttonText}</span>

src/components/gallery/ShowcaseCard/styles.module.css

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
overflow: hidden;
120120
transition: box-shadow 0.3s, transform 0.3s;
121121
box-shadow: none !important;
122-
border: 1px solid #0078d426 !important;
122+
border: none !important;
123123
transform-origin: center;
124124
position: relative;
125125
}
@@ -148,6 +148,48 @@
148148
margin-top: 12px;
149149
}
150150

151+
/* Grid-view card structural sections */
152+
.cardContent {
153+
flex: 1;
154+
display: flex;
155+
flex-direction: column;
156+
border-top: 1px solid #0078d426;
157+
border-left: 1px solid #0078d426;
158+
border-right: 1px solid #0078d426;
159+
border-radius: 16px 16px 0 0;
160+
overflow: hidden;
161+
}
162+
163+
.cardFooterAction {
164+
display: flex;
165+
align-items: center;
166+
justify-content: center;
167+
width: 100%;
168+
padding: 14px 16px;
169+
min-height: 48px;
170+
font-size: 14px;
171+
font-weight: 600;
172+
line-height: 1;
173+
text-decoration: none !important;
174+
cursor: pointer;
175+
box-sizing: border-box;
176+
/* only the top divider border is set; left/right/bottom are covered by
177+
the inset box-shadow in the same accent color (set inline), so the
178+
accent wraps the full section edge-to-edge */
179+
border-left: none;
180+
border-right: none;
181+
border-bottom: none;
182+
/* match card's bottom corners so overflow:hidden clips cleanly */
183+
border-radius: 0 0 16px 16px;
184+
margin: 0;
185+
transition: filter 0.15s ease;
186+
}
187+
188+
.cardFooterAction:hover {
189+
filter: brightness(0.93);
190+
text-decoration: none !important;
191+
}
192+
151193
/* Mobile breakpoint: cap card size to 600px and center */
152194
@media screen and (max-width: 768px) {
153195
.card {

src/components/gallery/ShowcaseListTile/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export default function ShowcaseListTile({
115115
paddingLeft: "16px",
116116
paddingRight: "16px",
117117
...ctaStyles,
118+
borderRadius: "1px",
118119
}}
119120
>
120121
<span>{buttonText}</span>

src/utils/buttonStyleUtils.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ const BUTTON_STYLE_MAP: Record<string, ButtonStyles> = {
2424
borderRadius: "3px 3px 14px 14px",
2525
},
2626
Video: {
27-
backgroundColor: "#FEF7EE",
28-
border: "1px solid #DDC4A2",
29-
color: "#CE811D",
27+
backgroundColor: "#FFEFFD",
28+
border: "1px solid #E6B9E1",
29+
color: "#B140A3",
3030
borderRadius: "3px 3px 14px 14px",
3131
},
3232
Training: {
@@ -42,9 +42,9 @@ const BUTTON_STYLE_MAP: Record<string, ButtonStyles> = {
4242
borderRadius: "3px 3px 14px 14px",
4343
},
4444
Blog: {
45-
backgroundColor: "#FFEFFD",
46-
border: "1px solid #E6B9E1",
47-
color: "#B140A3",
45+
backgroundColor: "#FEF7EE",
46+
border: "1px solid #DDC4A2",
47+
color: "#CE811D",
4848
borderRadius: "3px 3px 14px 14px",
4949
},
5050
};

0 commit comments

Comments
 (0)