Skip to content

Commit b060ae0

Browse files
Merge pull request #311 from CivicDataLab/309-align-cards-make-cards-same-size-and-add-hover-effect
align cards, make cards same size, and add hover effect
2 parents ff81f5b + 8dbebce commit b060ae0

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

app/[locale]/(user)/sectors/SectorsListing.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,28 +201,38 @@ const SectorsListing = () => {
201201
<Link
202202
href={`/sectors/${sectors.slug}?sectors=${capitalizeWords(sectors.slug)}`}
203203
key={sectors.id}
204+
className="h-full" // Ensure link takes full height
204205
>
205-
<div className="flex w-full items-center gap-5 rounded-4 bg-surfaceDefault p-7 shadow-card">
206-
<div className="flex gap-4">
206+
<div className="flex h-full min-h-[140px] w-full items-center gap-5 rounded-4 bg-surfaceDefault p-7 shadow-card transition-transform duration-300 ease-in-out hover:scale-105 hover:shadow-lg">
207+
<div className="flex flex-shrink-0 gap-4">
207208
<Image
208209
src={`/Sectors/${sectors.name}.svg`}
209210
width={80}
210211
height={80}
211212
alt={'Sectors Logo'}
213+
className="h-20 w-20 object-contain" // Ensure consistent image sizing
212214
/>
213215
</div>
214-
<div className="flex w-full flex-col gap-3">
216+
<div className="flex w-full min-w-0 flex-col justify-between h-full gap-3">
217+
{' '}
218+
{/* min-w-0 prevents text overflow */}
215219
<div className="flex flex-col gap-2">
216-
<Text variant="headingLg" fontWeight="semibold">
220+
<Text
221+
variant="headingLg"
222+
fontWeight="semibold"
223+
className="line-clamp-1 text-ellipsis overflow-hidden"
224+
>
217225
{sectors.name}
218226
</Text>
219-
<Divider className=" h-[2px] bg-greyExtralight" />
227+
<Divider className="h-[2px] bg-greyExtralight" />
220228
</div>
221229
<div className="flex gap-1">
230+
{' '}
231+
{/* mt-auto pushes to bottom */}
222232
<Text
223233
variant="bodyMd"
224234
fontWeight="bold"
225-
className=" text-primaryBlue"
235+
className="text-primaryBlue"
226236
>
227237
{sectors.datasetCount}
228238
</Text>

styles/tokens/_variables.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
--base-amber-solid-12: #4e2009;
8686
--base-pure-white: #ffffff;
8787
--base-pure-black: #000000;
88-
--blue-primary-color: #1f5f8d;
88+
--blue-primary-color: #0b3865;
8989
--orange-secondary-color: #fdb557;
9090
--blue-primary-text: #194C71;
9191
--orange-secondary-text: #b17f3d;

0 commit comments

Comments
 (0)