Search improvements (#76)

* Search improvements

* Search results keyboard navigation
This commit is contained in:
Tom Moor
2017-05-31 20:23:09 -07:00
committed by GitHub
parent d853821186
commit 74d65aba67
9 changed files with 156 additions and 105 deletions

View File

@ -1,6 +1,6 @@
// @flow
import React from 'react';
import styles from './CenteredContent.scss';
import styled from 'styled-components';
type Props = {
children?: React.Element<any>,
@ -8,21 +8,27 @@ type Props = {
maxWidth?: string,
};
const CenteredContent = (props: Props) => {
const style = {
maxWidth: props.maxWidth,
...props.style,
const Container = styled.div`
width: 100%;
margin: 40px 20px;
`;
const CenteredContent = ({
children,
maxWidth = '740px',
style,
...rest
}: Props) => {
const styles = {
maxWidth,
...style,
};
return (
<div className={styles.content} style={style}>
{props.children}
</div>
<Container style={styles} {...rest}>
{children}
</Container>
);
};
CenteredContent.defaultProps = {
maxWidth: '740px',
};
export default CenteredContent;