From bc03c2572768c42f1cd5085728014a103e050ae6 Mon Sep 17 00:00:00 2001 From: Christian Grail Date: Mon, 20 Apr 2020 13:42:31 +0200 Subject: [PATCH] If city and country are equal - show only one - helpful for Online, Online --- .../ConferenceItem/ConferenceItem.tsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/ConferenceItem/ConferenceItem.tsx b/src/components/ConferenceItem/ConferenceItem.tsx index 1a71e515..505b82a8 100644 --- a/src/components/ConferenceItem/ConferenceItem.tsx +++ b/src/components/ConferenceItem/ConferenceItem.tsx @@ -1,8 +1,8 @@ -import React, {PureComponent} from 'react'; +import React, { PureComponent } from 'react'; import classNames from 'classnames'; -import {parse} from 'date-fns'; +import { parse } from 'date-fns'; -import {formatDate, generateEventJSONLD} from './utils'; +import { formatDate, generateEventJSONLD } from './utils'; import Heading from '../Heading'; import Link from '../Link'; import styles from './ConferenceItem.scss'; @@ -72,12 +72,12 @@ export default class ConferenceItem extends PureComponent { } private trackAffiliate = (event: React.MouseEvent) => { - const {href} = event.currentTarget; + const { href } = event.currentTarget; this.track('outbound-affiliate', href); }; private trackLink = (event: React.MouseEvent) => { - const {href} = event.currentTarget; + const { href } = event.currentTarget; this.track('outbound', href); }; @@ -91,7 +91,7 @@ export default class ConferenceItem extends PureComponent { interface TwitterProps { twitter: string; } -function Twitter({twitter}: TwitterProps) { +function Twitter({ twitter }: TwitterProps) { if (!twitter) { return null; } @@ -107,7 +107,7 @@ function Twitter({twitter}: TwitterProps) { } function Location(city: string, country: string) { - if (city && country) { + if (city && country && city !== country) { return `${city}, ${country}`; } @@ -119,7 +119,7 @@ interface CfpProps { date: string; } -function Cfp({url, date}: CfpProps) { +function Cfp({ url, date }: CfpProps) { return ( CFP closes {formatDate(parse(date))} @@ -131,7 +131,7 @@ interface TopicsProps { topics: string[]; } -function Topics({topics}: TopicsProps) { +function Topics({ topics }: TopicsProps) { return <>{topics.map(topic => `#${topic}`).join(' ')}; } @@ -147,7 +147,7 @@ interface AffiliateProps { callback: (event: React.MouseEvent) => void; } -function Affiliate({url, text, callback}: AffiliateProps) { +function Affiliate({ url, text, callback }: AffiliateProps) { if (!url) { return null; }