Files
outline/app/components/Editor/components/HorizontalRule.js
2017-11-10 14:14:30 -08:00

22 lines
581 B
JavaScript

// @flow
import React from 'react';
import styled from 'styled-components';
import type { Props } from '../types';
import { color } from 'shared/styles/constants';
function HorizontalRule(props: Props) {
const { state, node, attributes } = props;
const active = state.isFocused && state.selection.hasEdgeIn(node);
return <StyledHr active={active} {...attributes} />;
}
const StyledHr = styled.hr`
padding-top: 0.75em;
margin: 0;
border: 0;
border-bottom: 1px solid
${props => (props.active ? color.slate : color.slateLight)};
`;
export default HorizontalRule;