Skip to content

Commit a986421

Browse files
nimzcoNima Izadi
authored and
Nima Izadi
committed
Added back add a conference link
1 parent b9d0260 commit a986421

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

src/components/ConferenceList/ConferenceList.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {connectHits} from 'react-instantsearch/connectors';
55

66
import Heading from '../Heading';
77
import Divider from '../Divider';
8+
import Link from '../Link';
89
import ConferenceItem from '../ConferenceItem';
910
import styles from './ConferenceList.css';
1011

@@ -29,7 +30,7 @@ class ConferenceList extends Component {
2930
};
3031

3132
render() {
32-
const {hits, showCFP, sortBy} = this.props;
33+
const {hits, showCFP, sortBy, addConferenceUrl} = this.props;
3334
let filteredConferences = hits;
3435
if (showCFP) {
3536
filteredConferences = filter(hits, (conf) => {
@@ -41,7 +42,7 @@ class ConferenceList extends Component {
4142
const confsTable = Object.keys(confs).map((year) => {
4243
return [
4344
<Divider key="hr" />,
44-
<Year key={year} year={year} />,
45+
<Year key={year} year={year} addConferenceUrl={addConferenceUrl} />,
4546
this.renderConferences(confs[year]),
4647
];
4748
});
@@ -92,12 +93,15 @@ function Months({month, conferences, showCFP}) {
9293
];
9394
}
9495

95-
function Year({year}) {
96+
function Year({year, addConferenceUrl}) {
9697
return (
9798
<div className={styles.Year}>
9899
<Heading key={year} element="h2" level={2}>
99100
{year}
100101
</Heading>
102+
<Link url={addConferenceUrl} external>
103+
Add a conference
104+
</Link>
101105
</div>
102106
);
103107
}

src/components/ConferencePage/ConferencePage.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Link from '../Link';
1919
import GithubStar from '../GithubStar';
2020
import Heading from '../Heading';
2121
import ConferenceList from '../ConferenceList';
22-
import {TOPICS} from '../config';
22+
import {TOPICS, getAddConferenceUrl} from '../config';
2323

2424
const CURRENT_YEAR = (new Date()).getYear() + 1900;
2525
const TODAY = Math.round(new Date().getTime() / 1000);
@@ -74,6 +74,7 @@ class ConferencePage extends Component {
7474
render() {
7575
const {showPast, sortBy} = this.state;
7676
const {showCFP, match: {params: {type, country}}} = this.props;
77+
const addConferenceUrl = getAddConferenceUrl(type);
7778

7879
return (
7980
<div>
@@ -121,6 +122,7 @@ class ConferencePage extends Component {
121122
{showCFP && <CfpHeader sortByCfpEndDate={this.sortByCfpEndDate} sortBy={sortBy} />}
122123

123124
<ConferenceList
125+
addConferenceUrl={addConferenceUrl}
124126
sortBy={sortBy}
125127
showCFP={showCFP}
126128
/>
@@ -129,6 +131,7 @@ class ConferencePage extends Component {
129131
<Footer
130132
showCFP={showCFP}
131133
togglePast={this.togglePast}
134+
addConferenceUrl={addConferenceUrl}
132135
showPast={showPast}
133136
/>
134137
</div>

src/components/Footer/Footer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ import styles from './Footer.scss';
55
import Link from '../Link';
66

77
const CURRENT_YEAR = (new Date()).getYear() + 1900;
8-
export default function Footer({showCFP, togglePast, showPast}) {
8+
export default function Footer({showCFP, togglePast, showPast, addConferenceUrl}) {
99
return (
1010
<footer className={styles.Footer}>
1111
<HiddenLinks />
1212
<p className={styles.FooterLinks}>
13+
<Link url={addConferenceUrl} external>
14+
Add a conference
15+
</Link>
1316
<Link selected={showPast} onClick={togglePast}>
1417
{showPast ? 'Hide past conferences' : 'See past conferences'}
1518
</Link>

src/components/config/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,18 @@ export const TOPICS = {
1010
php: 'PHP',
1111
general: 'General',
1212
};
13+
14+
const REPO_URLS = {
15+
javascript: 'https://github.com/tech-conferences/javascript-conferences',
16+
css: 'https://github.com/tech-conferences/confs.tech',
17+
php: 'https://github.com/tech-conferences/confs.tech',
18+
ux: 'https://github.com/tech-conferences/confs.tech',
19+
ruby: 'https://github.com/tech-conferences/confs.tech',
20+
ios: 'https://github.com/tech-conferences/confs.tech',
21+
android: 'https://github.com/tech-conferences/confs.tech',
22+
general: 'https://github.com/tech-conferences/confs.tech',
23+
};
24+
25+
export function getAddConferenceUrl(type = 'JavaScript') {
26+
return `${REPO_URLS[type.toLocaleLowerCase()]}/issues/new`;
27+
}

0 commit comments

Comments
 (0)