import { injectGlobal } from 'styled-components';
import { normalize } from 'polished';
const applyGlobalStyles = () => injectGlobal`
${normalize()}
`;
export default applyGlobalStyles;
import * as React from 'react';
import styled from 'styled-components';
import { Map } from "immutable";
import { withRaven } from 'app-lib/index';
const Wrapper: any = styled.div`
display: flex;
align-items: center;
width:100%;
font-family: ${props => props.theme.serifFamily};
`;
const PreviewWrapper: any = styled.a`
display: inline-block;
margin-left: 24px;
`;
const Preview = styled.div`
width: 160px;
height: 100px;
background-image: url(${(props: { src: string }) => props.src});
background-position: center center;
background-size: cover;
`;
const A: any = styled.a`
color: ${props => props.theme.linkColor};
font-size: 32px;
font-style: italic;
line-height: 36px;
`;
interface Props {
data: Map<any, any>
}
interface State {}
class Link extends React.Component<Props, State> {
static displayName = 'Link';
shouldComponentUpdate(nextProps: Props, nextState: State) {
return nextProps.data !== this.props.data;
}
@withRaven
render() {
const { data } = this.props;
const link = data.get('url');
const url = link.get('url');
const title = link.get('title');
const image = link.get('image');
return (
<Wrapper>
<A href={url}>{title}</A>
{image && (
<PreviewWrapper href={url}>
<Preview src={image} />
</PreviewWrapper>
)}
</Wrapper>
);
}
}
export default Link;
*/${p => console.log('p!@#$%$^', p) && 'color:red;'}; */
*/background: ${props => (props.bg ? 'palevioletred' : 'white')}; */
font-size: 20px;