Skip to content

Commit b6c15c7

Browse files
fix: enhanced the alignment of speaker card. (#753)
Co-authored-by: EuniceChidinmaImo <eunicechidinma.ei@gmail.com>
1 parent ecea271 commit b6c15c7

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

components/Speaker/speaker.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ interface ISpeaker {
99
}
1010

1111
function Speaker({ details, location, className }: ISpeaker): JSX.Element {
12+
13+
function getName(names: string[]){
14+
return `${names[0]} ${names[1]}`;
15+
}
16+
const shortenedName = details.name.length > 20 ? getName(details.name.split(' ')) : details.name;
17+
1218
return (
1319
<div
14-
className={`w-auto text-center flex flex-col items-center card h-auto rounded-md p-[27px] ${className}`}
20+
className={`w-auto text-center flex flex-col items-center card rounded-md p-[27px] ${className}`}
1521
data-test="speakers-section"
1622
>
1723
<div className="w-[300px] h-[300px] lg:w-[250px] lg:h-[250px] relative overflow-hidden rounded-full border-2 border-gray-300 bg-gray-800">
@@ -25,7 +31,7 @@ function Speaker({ details, location, className }: ISpeaker): JSX.Element {
2531
/>
2632
</div>
2733
<div className="mt-[19px]">
28-
<h3 className="text-[23px] text-white">{details.name}</h3>
34+
<h3 className="text-[23px] text-white">{shortenedName}</h3>
2935
<div className={`flex flex-col ${'min-h-[150px]'} justify-between`}>
3036
<div>
3137
{' '}

0 commit comments

Comments
 (0)