ens-usernames/app/ui/components/Info.js

38 lines
800 B
JavaScript
Raw Normal View History

import React from 'react'
import styled from 'styled-components'
import PropTypes from 'prop-types'
import theme from '../theme'
import { Action, Permissions } from './IconInfo'
const Info = ({ children, title, ...props }) => (
<Main {...props}>
{title && <Title>{title}</Title>}
{children}
</Main>
)
Info.propTypes = {
background: PropTypes.string,
children: PropTypes.node,
title: PropTypes.node,
}
Info.defaultProps = {
background: theme.infoBackground,
}
const Main = styled.section`
background: ${({ background }) => background};
padding: 15px;
2018-07-10 18:41:46 +00:00
border-radius: 4px;
word-wrap: break-word;
`
const Title = styled.h1`
display: flex;
margin-top: 0px; // needed to overwrite bootstrap.css
`
Info.Action = Action
Info.Permissions = Permissions
export default Info