Skip to content

Commit d40471e

Browse files
enhanced the alignment of speaker card.
1 parent ecea271 commit d40471e

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
@@ -1,6 +1,7 @@
11
import Image from 'next/image';
22
import React from 'react';
33
import { Speaker as SpeakerTypes } from '../../types/types';
4+
import { get } from 'cypress/types/lodash';
45

56
interface ISpeaker {
67
details: SpeakerTypes;
@@ -9,9 +10,14 @@ interface ISpeaker {
910
}
1011

1112
function Speaker({ details, location, className }: ISpeaker): JSX.Element {
13+
14+
function getName(names: string[]){
15+
return `${names[0]} ${names[1]}`;
16+
}
17+
const shortenedName = details.name.length > 20 ? getName(details.name.split(' ')) : details.name;
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)