Skip to content

Commit

Permalink
Remove unncessary comp. Fix spacing for github link
Browse files Browse the repository at this point in the history
  • Loading branch information
simonccarter committed Jun 18, 2019
1 parent 9744f2e commit b0d8a4c
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 167 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ workflows:
only:
- develop
- fix/circleci
- fix/spacing
- deploy-master:
requires:
- set-up
Expand Down
40 changes: 0 additions & 40 deletions src/components/ConfPageHeader/ConfPageHeader.scss

This file was deleted.

22 changes: 0 additions & 22 deletions src/components/ConfPageHeader/ConfPageHeader.spec.tsx

This file was deleted.

41 changes: 0 additions & 41 deletions src/components/ConfPageHeader/ConfPageHeader.tsx

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/components/ConfPageHeader/index.ts

This file was deleted.

22 changes: 13 additions & 9 deletions src/components/Header/Header.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { mount } from 'enzyme'
import toJSON from 'enzyme-to-json'
import * as React from 'react'
import { mount } from 'enzyme';
import toJSON from 'enzyme-to-json';
import * as React from 'react';

import { wrapWithMemoryRouter } from 'utils/test'
import { Header } from './Header'
import { wrapWithMemoryRouter } from 'utils/test';
import { Header } from './Header';

describe('Header', () => {
it('should render', () => {
// arrange
// act
const comp = mount(wrapWithMemoryRouter(<Header />))
const comp = mount(
wrapWithMemoryRouter(
<Header title="A title" tagline="A tagline" titleLink="/a-link" />
)
);

// assert
expect(toJSON(comp)).toMatchSnapshot()
})
})
expect(toJSON(comp)).toMatchSnapshot();
});
});
22 changes: 16 additions & 6 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,37 @@ import * as cn from 'classnames';
import * as React from 'react';

import { Logo } from 'components';
import { Link } from 'react-router-dom';

import styles from './Header.scss';

export const Header: React.FunctionComponent<{}> = () => (
type Props = {
title: string;
titleLink: string;
tagline: string;
};

export const Header: React.FunctionComponent<Props> = ({
title,
titleLink,
tagline
}) => (
<div className={styles.header}>
<Logo />
<div className={styles.text}>
<h1 className={styles.headerTitle}>
<Link to="/search" className={styles.link}>
React.js Videos
</Link>
<a href={titleLink} className={styles.link}>
{title}
</a>
</h1>
<p className={styles.headerText}> Search React.js conference videos. </p>
<p className={styles.headerText}> {tagline} </p>
<p className={cn(styles.headerText, styles.contribute)}>
Contribute
<a
className={styles.contributeLink}
href="https://github.com/simonccarter/react-conf-videos"
aria-label="Contribute at our github repo"
>
{' '}
at our github repo
</a>
.
Expand Down
4 changes: 2 additions & 2 deletions src/components/Pages/ConfPage/ConfPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
ConfPageHeader,
Header,
InnerLayoutContainer,
List,
Meta,
Expand Down Expand Up @@ -36,7 +36,7 @@ export const ConfPageInner: React.FunctionComponent<Props> = ({
return (
<div>
<Meta title={conference.title} />
<ConfPageHeader
<Header
title={conference.title}
titleLink={conference.website}
tagline={`
Expand Down
6 changes: 5 additions & 1 deletion src/components/Pages/FrontPage/FrontPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export const FrontPageInner: React.FunctionComponent<Props> = ({
return (
<div>
<Meta title={filterValue} />
<Header />
<Header
title="React.js Videos"
titleLink="/#/search"
tagline="Search React.js conference videos."
/>
<InnerLayoutContainer>
<SearchInput filterValue={filterValue} onChange={onInputChange} />
<ResultDetails conferences={conferences} />
Expand Down
2 changes: 0 additions & 2 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ConferenceDetails } from 'components/ConferenceDetails';
import { ConfPageHeader } from 'components/ConfPageHeader';
import { Header } from 'components/Header';
import { ScrollToTop } from 'components/HOCS/ScrollToTop';
import { Tracker } from 'components/HOCS/Tracker';
Expand All @@ -24,7 +23,6 @@ export {
ScrollToTop,
SearchInput,
ResultDetails,
ConfPageHeader,
ConferenceDetails,
InnerLayoutContainer
};

0 comments on commit b0d8a4c

Please sign in to comment.