Skip to content

Commit

Permalink
chore: rename components to have name in filepath
Browse files Browse the repository at this point in the history
  • Loading branch information
luhmann committed Feb 15, 2019
1 parent ab00616 commit 6500f70
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 24 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,26 @@ import React from 'react';
import PropTypes from 'prop-types';
import { graphql, StaticQuery } from 'gatsby';
import { Helmet } from 'react-helmet';
import { ThemeProvider } from 'styled-components';
import styled, { ThemeProvider } from 'styled-components';

import { Background, Logo, Menu, StyledLink, RootPageStyle } from 'components/';
import { mapAllGalleriesGraphQLResponse } from 'utils/mappings';
import { albumInfoType, locationType } from 'utils/types';

import theme from '../../theme';

const HeaderContainer = styled.div`
position: sticky;
top: 0;
`;

const Header = ({ albums }) => (
<>
<HeaderContainer>
<StyledLink to="/" color="black">
<Logo />
</StyledLink>
<Menu albums={albums} />
</>
</HeaderContainer>
);

Header.propTypes = {
Expand All @@ -37,7 +42,7 @@ export const LayoutComponent = ({ children, albums, location }) => (
<ThemeProvider theme={theme}>
{/* NOTE: Fragment is important here otherwise the context-provider complains about multiple children */}
<>
{/* TODO: convoluted helmet-syntax due to https://github.com/nfl/react-helmet/issues/373 */}
{/* TODO: convoluted helmet-syntax due to this bug https://github.com/nfl/react-helmet/issues/373 */}
<Helmet
title="J F Dietrich Photography"
meta={[
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout/Layout.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { render } from 'react-testing-library';
import generateProps from 'react-generate-props';

import { LayoutComponent } from './';
import { LayoutComponent } from './Layout';

const createTestProps = (custom = {}) => ({
...generateProps(LayoutComponent, { optional: true }),
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Logo/Logo.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { render } from 'react-testing-library';

import Logo from './';
import Logo from './Logo';

test('should render as expected', () => {
const { container } = render(<Logo />);
Expand Down
11 changes: 0 additions & 11 deletions src/components/Menu/index.js → src/components/Menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,6 @@ const Menu = ({ albums }) => {
data-testid="menu-slideout"
visible={isOpen}
>
{/* <StyledLink
to="/"
color="black"
fontFamily="body"
fontSize={['m', 'l']}
fontWeight="bold"
display="block"
mb={2}
>
Home
</StyledLink> */}
{albums.map(album => (
<React.Fragment key={album.albumTitle}>
<Album data-testid="menu-album">{album.albumTitle}</Album>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Menu/Menu.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { render, fireEvent } from 'react-testing-library';

import Menu from './';
import Menu from './Menu';

const createGallery = (title, path) => ({
title,
Expand Down
File renamed without changes.
14 changes: 8 additions & 6 deletions src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export { default as Background } from './Background';
export { default as ContentContainer } from './ContentContainer';
export { default as Logo } from './Logo';
export { default as Menu } from './Menu';
export { default as StyledLink } from './StyledLink';
export { default as Layout } from './Layout';
export { default as Background } from './Background/Background';
export {
default as ContentContainer,
} from './ContentContainer/ContentContainer';
export { default as Logo } from './Logo/Logo';
export { default as Menu } from './Menu/Menu';
export { default as StyledLink } from './StyledLink/StyledLink';
export { default as Layout } from './Layout/Layout';
export { RootPageStyle } from './global-styles';

0 comments on commit 6500f70

Please sign in to comment.