Skip to content

Commit e2aa74e

Browse files
authored
feat: improve cards styles (#1565)
* improve cards styles * fix conversation header image
1 parent 689699b commit e2aa74e

File tree

5 files changed

+29
-17
lines changed

5 files changed

+29
-17
lines changed

components/resources/ResourceConversationHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const ResourceConversationHeader = (props: ResourceConversationHeaderProp
5858
</Box>
5959
</Box>
6060
}
61-
imageSrc={header_image ? header_image.filename : illustrationCourses}
61+
imageSrc={header_image?.filename || illustrationCourses}
6262
progressStatus={resourceProgress}
6363
>
6464
<Button

components/storyblok/StoryblokResourceConversationPage.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use client';
22

3-
import { SignUpBanner } from '@/components/banner/SignUpBanner';
43
import ResourceFeedbackForm from '@/components/forms/ResourceFeedbackForm';
54
import { LANGUAGES, PROGRESS_STATUS, RESOURCE_CATEGORIES } from '@/lib/constants/enums';
65
import { RESOURCE_CONVERSATION_VIEWED } from '@/lib/constants/events';
@@ -161,7 +160,6 @@ const StoryblokResourceConversationPage = (props: StoryblokResourceConversationP
161160
userId,
162161
)}
163162
/>
164-
{!isLoggedIn && <SignUpBanner />}
165163
</Box>
166164
);
167165
};

components/storyblok/StoryblokResourceSingleVideoPage.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use client';
22

3-
import { SignUpBanner } from '@/components/banner/SignUpBanner';
43
import ResourceFeedbackForm from '@/components/forms/ResourceFeedbackForm';
54
import {
65
LANGUAGES,
@@ -197,8 +196,6 @@ const StoryblokResourceSingleVideoPage = (props: StoryblokResourceSingleVideoPag
197196
relatedExercises={related_exercises}
198197
userContentPartners={getContentPartners}
199198
/>
200-
201-
{!isLoggedIn && <SignUpBanner />}
202199
</Box>
203200
);
204201
};

components/storyblok/StoryblokTeamMemberCard.tsx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const cardStyle = {
2020
alignSelf: 'flex-start',
2121
width: '100%',
2222
maxWidth: 550,
23-
backgroundColor: 'background.default',
2423
} as const;
2524

2625
const cardContentStyle = {
@@ -40,6 +39,13 @@ const cardHeaderStyle = {
4039
' p': {
4140
mx: '0 !important',
4241
},
42+
':hover': {
43+
a: {
44+
':after': {
45+
background: 'linear-gradient(90deg,rgba(254, 246, 242, 0) 0%, rgba(249, 237, 237, 1) 100%)',
46+
},
47+
},
48+
},
4349
} as const;
4450

4551
const imageContainerStyle = {
@@ -89,7 +95,14 @@ const iconStyles = {
8995
const expandButtonContainerStyles = {
9096
textAlign: 'right',
9197
mt: 'auto',
92-
};
98+
} as const;
99+
100+
const websiteHeaderLinkStyle = {
101+
textDecoration: 'none',
102+
':hover': {
103+
textDecoration: 'underline',
104+
},
105+
} as const;
93106

94107
export interface StoryblokTeamMemberCardProps {
95108
_uid: string;
@@ -191,9 +204,14 @@ const StoryblokTeamMemberCard = (props: StoryblokTeamMemberCardProps) => {
191204
</Box>
192205
)}
193206
{show_short_bio && website?.url && (
194-
<Box sx={{ ...iconRowStyles, ...fadeOut }}>
207+
<Box sx={{ ...iconRowStyles }}>
195208
<LinkIcon color="error" sx={iconStyles} />
196-
<Link variant="body2" href={website.url} sx={{ textDecoration: 'none' }}>
209+
<Link
210+
id="website-link"
211+
variant="body2"
212+
href={website.url}
213+
sx={{ ...websiteHeaderLinkStyle, ...fadeOut }}
214+
>
197215
{websiteTitle}
198216
</Link>
199217
</Box>

styles/theme.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,25 +327,22 @@ theme = createTheme(theme, {
327327
MuiCard: {
328328
styleOverrides: {
329329
root: {
330-
backgroundColor: theme.palette.common.white,
330+
backgroundColor: theme.palette.background.default,
331331
boxShadow: '0px 1px 3px 0px rgba(0, 0, 0, 0.12);',
332332
marginTop: 20,
333333

334-
'&:hover': { backgroundColor: theme.palette.common.white },
335-
336334
[theme.breakpoints.up('md')]: {
337335
marginTop: 0,
338336
},
339337
},
340338
},
341339
},
340+
342341
MuiCardContent: {
343342
styleOverrides: {
344343
root: {
345-
backgroundColor: theme.palette.background.default,
346344
padding: 24,
347345
paddingTop: 30,
348-
'&:hover': { backgroundColor: theme.palette.common.white },
349346

350347
[theme.breakpoints.up('md')]: {
351348
padding: 40,
@@ -360,9 +357,11 @@ theme = createTheme(theme, {
360357
MuiCardActionArea: {
361358
styleOverrides: {
362359
root: {
360+
backgroundColor: theme.palette.background.default,
361+
'&:hover': { backgroundColor: theme.palette.common.white },
362+
'.Mui-disabled &:hover': { backgroundColor: theme.palette.common.white },
363363
'& .MuiTouchRipple-root span': {
364-
backgroundColor: theme.palette.primary.main,
365-
opacity: 0.4,
364+
display: 'none',
366365
},
367366
},
368367
focusHighlight: {

0 commit comments

Comments
 (0)