fix: comma and gap

fix/activity
Arik Chakma 7 months ago
parent f6d4da48f9
commit 755e494224
  1. 14
      src/components/Activity/ActivityTopicTitles.tsx

@ -12,13 +12,13 @@ export function ActivityTopicTitles(props: ActivityTopicTitlesProps) {
<> <>
{firstThreeTopics.map((topicTitle, index) => { {firstThreeTopics.map((topicTitle, index) => {
return ( return (
<span> <span className="font-medium">
<> <>
{topicTitles.length > 3 && index === 2 {index > 0 && ', '}
? `${topicTitle}, ` {index === firstThreeTopics.length - 1 &&
: index === 2 firstThreeTopics.length > 1 &&
? `and ${topicTitle}` 'and '}
: `${topicTitle}, `} {topicTitle}
</> </>
</span> </span>
); );
@ -26,7 +26,7 @@ export function ActivityTopicTitles(props: ActivityTopicTitlesProps) {
{remainingTopics?.length > 0 && ( {remainingTopics?.length > 0 && (
<> <>
and &nbsp;and&nbsp;
<button <button
className="font-medium underline underline-offset-2 hover:text-black" className="font-medium underline underline-offset-2 hover:text-black"
onClick={onSelectActivity} onClick={onSelectActivity}

Loading…
Cancel
Save