mirror of
https://github.com/trezor/trezor-wallet
synced 2025-06-05 15:48:47 +00:00
Create "Paragraph" component for "</p>" element
This commit is contained in:
parent
b81cbe2cfc
commit
c67335170a
32
src/js/components/Paragraph/index.js
Normal file
32
src/js/components/Paragraph/index.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import styled, { css } from 'styled-components';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import colors from 'config/colors';
|
||||||
|
import { FONT_SIZE, LINE_HEIGHT } from 'config/variables';
|
||||||
|
|
||||||
|
const Wrapper = styled.p`
|
||||||
|
font-size: ${FONT_SIZE.BASE};
|
||||||
|
line-height: ${LINE_HEIGHT.BASE};
|
||||||
|
color: ${colors.TEXT_SECONDARY};
|
||||||
|
|
||||||
|
${props => props.isSmaller && css`
|
||||||
|
font-size: ${FONT_SIZE.SMALLER};
|
||||||
|
`}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const P = ({ children, className, isSmaller = false }) => (
|
||||||
|
<Wrapper
|
||||||
|
className={className}
|
||||||
|
isSmaller={isSmaller}
|
||||||
|
>{children}
|
||||||
|
</Wrapper>
|
||||||
|
);
|
||||||
|
|
||||||
|
P.propTypes = {
|
||||||
|
className: PropTypes.string,
|
||||||
|
children: PropTypes.string.isRequired,
|
||||||
|
isSmaller: PropTypes.bool,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export default P;
|
Loading…
Reference in New Issue
Block a user