Skip to content

Commit

Permalink
Merge pull request #470 from tech-conferences/getRidOfOnlineOnline
Browse files Browse the repository at this point in the history
If city and country are equal - show only one - helpful for Online, Online
  • Loading branch information
cgrail authored Apr 20, 2020
2 parents 3e8e6a5 + bc03c25 commit 897ee99
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/components/ConferenceItem/ConferenceItem.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -72,12 +72,12 @@ export default class ConferenceItem extends PureComponent<Props & Conference> {
}

private trackAffiliate = (event: React.MouseEvent<HTMLAnchorElement>) => {
const {href} = event.currentTarget;
const { href } = event.currentTarget;
this.track('outbound-affiliate', href);
};

private trackLink = (event: React.MouseEvent<HTMLAnchorElement>) => {
const {href} = event.currentTarget;
const { href } = event.currentTarget;
this.track('outbound', href);
};

Expand All @@ -91,7 +91,7 @@ export default class ConferenceItem extends PureComponent<Props & Conference> {
interface TwitterProps {
twitter: string;
}
function Twitter({twitter}: TwitterProps) {
function Twitter({ twitter }: TwitterProps) {
if (!twitter) {
return null;
}
Expand All @@ -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}`;
}

Expand All @@ -119,7 +119,7 @@ interface CfpProps {
date: string;
}

function Cfp({url, date}: CfpProps) {
function Cfp({ url, date }: CfpProps) {
return (
<Link url={url} external className={styles.cfp}>
CFP closes {formatDate(parse(date))}
Expand All @@ -131,7 +131,7 @@ interface TopicsProps {
topics: string[];
}

function Topics({topics}: TopicsProps) {
function Topics({ topics }: TopicsProps) {
return <>{topics.map(topic => `#${topic}`).join(' ')}</>;
}

Expand All @@ -147,7 +147,7 @@ interface AffiliateProps {
callback: (event: React.MouseEvent<HTMLAnchorElement>) => void;
}

function Affiliate({url, text, callback}: AffiliateProps) {
function Affiliate({ url, text, callback }: AffiliateProps) {
if (!url) {
return null;
}
Expand Down

0 comments on commit 897ee99

Please sign in to comment.