Skip to content

Commit 46bfe17

Browse files
author
Kevin Koech
committed
fix: update CategoryCard styles and snapshots for improved layout and responsiveness
1 parent 2ac67c8 commit 46bfe17

File tree

4 files changed

+45
-38
lines changed

4 files changed

+45
-38
lines changed

apps/trustlab/src/components/CategoryCard/CategoryCard.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ const CategoryCard = forwardRef(function CategoryCard(props, ref) {
2424
backgroundColor: "transparent",
2525
img: { filter: "grayscale(100%)" },
2626
"&:hover img": { filter: "grayscale(0%)" },
27+
height: "100%",
28+
display: "flex",
29+
flexDirection: "column",
2730
}}
2831
{...other}
2932
>
@@ -55,22 +58,26 @@ const CategoryCard = forwardRef(function CategoryCard(props, ref) {
5558
/>
5659
</Box>
5760
)}
58-
<CardContent sx={{ p: 0, mt: 2, textDecoration: "none" }}>
61+
<CardContent
62+
sx={{
63+
p: 0,
64+
mt: 2,
65+
textDecoration: "none",
66+
flex: 1,
67+
height: "100%",
68+
display: "flex",
69+
flexDirection: "column",
70+
}}
71+
>
5972
<Typography sx={{ mt: 1.25, mb: 2 }} variant="h3" gutterBottom>
6073
{title}
6174
</Typography>
6275
{description && (
6376
<LexicalRichText
6477
elements={description}
78+
sx={{ flex: 1 }}
6579
TypographyProps={{
6680
variant: "p2",
67-
sx: {
68-
display: "-webkit-box",
69-
WebkitBoxOrient: "vertical",
70-
overflow: "hidden",
71-
textOverflow: "ellipsis",
72-
flex: 1,
73-
},
7481
}}
7582
/>
7683
)}

apps/trustlab/src/components/CategoryCard/CategoryCard.snap.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`<CategoryCard /> renders unchanged 1`] = `
44
<a
5-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-neeamg-MuiTypography-root-MuiLink-root-MuiPaper-root-MuiCard-root"
5+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-hx403l-MuiTypography-root-MuiLink-root-MuiPaper-root-MuiCard-root"
66
href="/test-link"
77
style="--Paper-shadow: none;"
88
>
@@ -19,21 +19,21 @@ exports[`<CategoryCard /> renders unchanged 1`] = `
1919
/>
2020
</div>
2121
<div
22-
class="MuiCardContent-root css-wwjmps-MuiCardContent-root"
22+
class="MuiCardContent-root css-76n4sy-MuiCardContent-root"
2323
>
2424
<h3
2525
class="MuiTypography-root MuiTypography-h3 MuiTypography-gutterBottom css-1m50nra-MuiTypography-root"
2626
>
2727
Test Research Category
2828
</h3>
2929
<div
30-
class="MuiBox-root css-0"
30+
class="MuiBox-root css-1rr4qq7"
3131
>
3232
<div
3333
class="payload-richtext"
3434
>
3535
<p
36-
class="MuiTypography-root MuiTypography-p2 css-19n1rv3-MuiTypography-root"
36+
class="MuiTypography-root MuiTypography-p2 css-afjcqe-MuiTypography-root"
3737
>
3838
This report is a baseline Information Ecosystem Assessment (IEA) of online communities in Kenya, mapping digital harms and malign actors, using the DISARM and D-RAIL frameworks for analysing weaponised hate speech, information manipulation and other forms of illicit influence operations.
3939
</p>
@@ -56,25 +56,25 @@ exports[`<CategoryCard /> renders unchanged 1`] = `
5656

5757
exports[`<CategoryCard /> renders without image 1`] = `
5858
<div
59-
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-167r1gz-MuiPaper-root-MuiCard-root"
59+
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-1mlpmcl-MuiPaper-root-MuiCard-root"
6060
style="--Paper-shadow: none;"
6161
>
6262
<div
63-
class="MuiCardContent-root css-wwjmps-MuiCardContent-root"
63+
class="MuiCardContent-root css-76n4sy-MuiCardContent-root"
6464
>
6565
<h3
6666
class="MuiTypography-root MuiTypography-h3 MuiTypography-gutterBottom css-1m50nra-MuiTypography-root"
6767
>
6868
Test Research Category
6969
</h3>
7070
<div
71-
class="MuiBox-root css-0"
71+
class="MuiBox-root css-1rr4qq7"
7272
>
7373
<div
7474
class="payload-richtext"
7575
>
7676
<p
77-
class="MuiTypography-root MuiTypography-p2 css-19n1rv3-MuiTypography-root"
77+
class="MuiTypography-root MuiTypography-p2 css-afjcqe-MuiTypography-root"
7878
>
7979
This report is a baseline Information Ecosystem Assessment (IEA) of online communities in Kenya, mapping digital harms and malign actors, using the DISARM and D-RAIL frameworks for analysing weaponised hate speech, information manipulation and other forms of illicit influence operations.
8080
</p>
@@ -86,7 +86,7 @@ exports[`<CategoryCard /> renders without image 1`] = `
8686

8787
exports[`<CategoryCard /> renders without link 1`] = `
8888
<div
89-
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-167r1gz-MuiPaper-root-MuiCard-root"
89+
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-1mlpmcl-MuiPaper-root-MuiCard-root"
9090
style="--Paper-shadow: none;"
9191
>
9292
<div
@@ -102,21 +102,21 @@ exports[`<CategoryCard /> renders without link 1`] = `
102102
/>
103103
</div>
104104
<div
105-
class="MuiCardContent-root css-wwjmps-MuiCardContent-root"
105+
class="MuiCardContent-root css-76n4sy-MuiCardContent-root"
106106
>
107107
<h3
108108
class="MuiTypography-root MuiTypography-h3 MuiTypography-gutterBottom css-1m50nra-MuiTypography-root"
109109
>
110110
Test Research Category
111111
</h3>
112112
<div
113-
class="MuiBox-root css-0"
113+
class="MuiBox-root css-1rr4qq7"
114114
>
115115
<div
116116
class="payload-richtext"
117117
>
118118
<p
119-
class="MuiTypography-root MuiTypography-p2 css-19n1rv3-MuiTypography-root"
119+
class="MuiTypography-root MuiTypography-p2 css-afjcqe-MuiTypography-root"
120120
>
121121
This report is a baseline Information Ecosystem Assessment (IEA) of online communities in Kenya, mapping digital harms and malign actors, using the DISARM and D-RAIL frameworks for analysing weaponised hate speech, information manipulation and other forms of illicit influence operations.
122122
</p>

apps/trustlab/src/components/CategoryList/ResearchCategoryList.snap.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exports[`<CategoryList /> renders unchanged 1`] = `
1111
class="MuiGrid2-root MuiGrid2-direction-xs-row MuiGrid2-grid-xs-12 MuiGrid2-grid-sm-4 css-8o12w-MuiGrid2-root"
1212
>
1313
<a
14-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-neeamg-MuiTypography-root-MuiLink-root-MuiPaper-root-MuiCard-root"
14+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-hx403l-MuiTypography-root-MuiLink-root-MuiPaper-root-MuiCard-root"
1515
href="/category-1"
1616
id="1"
1717
style="--Paper-shadow: none;"
@@ -29,21 +29,21 @@ exports[`<CategoryList /> renders unchanged 1`] = `
2929
/>
3030
</div>
3131
<div
32-
class="MuiCardContent-root css-wwjmps-MuiCardContent-root"
32+
class="MuiCardContent-root css-76n4sy-MuiCardContent-root"
3333
>
3434
<h3
3535
class="MuiTypography-root MuiTypography-h3 MuiTypography-gutterBottom css-1m50nra-MuiTypography-root"
3636
>
3737
Research Category 1
3838
</h3>
3939
<div
40-
class="MuiBox-root css-0"
40+
class="MuiBox-root css-1rr4qq7"
4141
>
4242
<div
4343
class="payload-richtext"
4444
>
4545
<p
46-
class="MuiTypography-root MuiTypography-p2 css-19n1rv3-MuiTypography-root"
46+
class="MuiTypography-root MuiTypography-p2 css-afjcqe-MuiTypography-root"
4747
>
4848
This report is a baseline Information Ecosystem Assessment (IEA) of online communities in Kenya, mapping digital harms and malign actors, using the DISARM and D-RAIL frameworks for analysing weaponised hate speech, information manipulation and other forms of illicit influence operations.
4949
</p>
@@ -67,7 +67,7 @@ exports[`<CategoryList /> renders unchanged 1`] = `
6767
class="MuiGrid2-root MuiGrid2-direction-xs-row MuiGrid2-grid-xs-12 MuiGrid2-grid-sm-4 css-8o12w-MuiGrid2-root"
6868
>
6969
<a
70-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-neeamg-MuiTypography-root-MuiLink-root-MuiPaper-root-MuiCard-root"
70+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-hx403l-MuiTypography-root-MuiLink-root-MuiPaper-root-MuiCard-root"
7171
href="/category-2"
7272
id="2"
7373
style="--Paper-shadow: none;"
@@ -85,21 +85,21 @@ exports[`<CategoryList /> renders unchanged 1`] = `
8585
/>
8686
</div>
8787
<div
88-
class="MuiCardContent-root css-wwjmps-MuiCardContent-root"
88+
class="MuiCardContent-root css-76n4sy-MuiCardContent-root"
8989
>
9090
<h3
9191
class="MuiTypography-root MuiTypography-h3 MuiTypography-gutterBottom css-1m50nra-MuiTypography-root"
9292
>
9393
Research Category 2
9494
</h3>
9595
<div
96-
class="MuiBox-root css-0"
96+
class="MuiBox-root css-1rr4qq7"
9797
>
9898
<div
9999
class="payload-richtext"
100100
>
101101
<p
102-
class="MuiTypography-root MuiTypography-p2 css-19n1rv3-MuiTypography-root"
102+
class="MuiTypography-root MuiTypography-p2 css-afjcqe-MuiTypography-root"
103103
>
104104
This report is a baseline Information Ecosystem Assessment (IEA) of online communities in Kenya, mapping digital harms and malign actors, using the DISARM and D-RAIL frameworks for analysing weaponised hate speech, information manipulation and other forms of illicit influence operations.
105105
</p>
@@ -123,7 +123,7 @@ exports[`<CategoryList /> renders unchanged 1`] = `
123123
class="MuiGrid2-root MuiGrid2-direction-xs-row MuiGrid2-grid-xs-12 MuiGrid2-grid-sm-4 css-8o12w-MuiGrid2-root"
124124
>
125125
<a
126-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-neeamg-MuiTypography-root-MuiLink-root-MuiPaper-root-MuiCard-root"
126+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-hx403l-MuiTypography-root-MuiLink-root-MuiPaper-root-MuiCard-root"
127127
href="/category-3"
128128
id="3"
129129
style="--Paper-shadow: none;"
@@ -141,21 +141,21 @@ exports[`<CategoryList /> renders unchanged 1`] = `
141141
/>
142142
</div>
143143
<div
144-
class="MuiCardContent-root css-wwjmps-MuiCardContent-root"
144+
class="MuiCardContent-root css-76n4sy-MuiCardContent-root"
145145
>
146146
<h3
147147
class="MuiTypography-root MuiTypography-h3 MuiTypography-gutterBottom css-1m50nra-MuiTypography-root"
148148
>
149149
Research Category 3
150150
</h3>
151151
<div
152-
class="MuiBox-root css-0"
152+
class="MuiBox-root css-1rr4qq7"
153153
>
154154
<div
155155
class="payload-richtext"
156156
>
157157
<p
158-
class="MuiTypography-root MuiTypography-p2 css-19n1rv3-MuiTypography-root"
158+
class="MuiTypography-root MuiTypography-p2 css-afjcqe-MuiTypography-root"
159159
>
160160
This report is a baseline Information Ecosystem Assessment (IEA) of online communities in Kenya, mapping digital harms and malign actors, using the DISARM and D-RAIL frameworks for analysing weaponised hate speech, information manipulation and other forms of illicit influence operations.
161161
</p>

apps/trustlab/src/components/ToolkitList/ToolkitList.snap.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports[`ToolkitList renders initial toolkits 1`] = `
1818
class="MuiGrid2-root MuiGrid2-direction-xs-row MuiGrid2-grid-xs-12 MuiGrid2-grid-sm-4 css-1nwtms1-MuiGrid2-root"
1919
>
2020
<a
21-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-87ondj-MuiTypography-root-MuiLink-root-MuiPaper-root-MuiCard-root"
21+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-161p3f9-MuiTypography-root-MuiLink-root-MuiPaper-root-MuiCard-root"
2222
href="/toolkits/a"
2323
id="t1"
2424
style="--Paper-shadow: none;"
@@ -36,15 +36,15 @@ exports[`ToolkitList renders initial toolkits 1`] = `
3636
/>
3737
</div>
3838
<div
39-
class="MuiCardContent-root css-wwjmps-MuiCardContent-root"
39+
class="MuiCardContent-root css-76n4sy-MuiCardContent-root"
4040
>
4141
<h3
4242
class="MuiTypography-root MuiTypography-h3 MuiTypography-gutterBottom css-1of270-MuiTypography-root"
4343
>
4444
Toolkit A
4545
</h3>
4646
<div
47-
class="MuiBox-root css-0"
47+
class="MuiBox-root css-1rr4qq7"
4848
>
4949
<div
5050
class="payload-richtext"
@@ -68,7 +68,7 @@ exports[`ToolkitList renders initial toolkits 1`] = `
6868
class="MuiGrid2-root MuiGrid2-direction-xs-row MuiGrid2-grid-xs-12 MuiGrid2-grid-sm-4 css-1nwtms1-MuiGrid2-root"
6969
>
7070
<a
71-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-87ondj-MuiTypography-root-MuiLink-root-MuiPaper-root-MuiCard-root"
71+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiCard-root css-161p3f9-MuiTypography-root-MuiLink-root-MuiPaper-root-MuiCard-root"
7272
href="/toolkits/b"
7373
id="t2"
7474
style="--Paper-shadow: none;"
@@ -86,15 +86,15 @@ exports[`ToolkitList renders initial toolkits 1`] = `
8686
/>
8787
</div>
8888
<div
89-
class="MuiCardContent-root css-wwjmps-MuiCardContent-root"
89+
class="MuiCardContent-root css-76n4sy-MuiCardContent-root"
9090
>
9191
<h3
9292
class="MuiTypography-root MuiTypography-h3 MuiTypography-gutterBottom css-1of270-MuiTypography-root"
9393
>
9494
Toolkit B
9595
</h3>
9696
<div
97-
class="MuiBox-root css-0"
97+
class="MuiBox-root css-1rr4qq7"
9898
>
9999
<div
100100
class="payload-richtext"

0 commit comments

Comments
 (0)