initial commit

This commit is contained in:
unknown 2021-07-28 18:45:52 +05:30
commit 026f835a87
176 changed files with 10613 additions and 0 deletions

View file

@ -0,0 +1,28 @@
import React from 'react';
import PropTypes from 'prop-types';
import './Text.scss';
function Text({
id, className, variant, children,
}) {
const cName = className !== '' ? `${className} ` : '';
if (variant === 'h1') return <h1 id={id === '' ? undefined : id} className={`${cName}text text-h1`}>{ children }</h1>;
if (variant === 'h2') return <h2 id={id === '' ? undefined : id} className={`${cName}text text-h2`}>{ children }</h2>;
if (variant === 's1') return <h4 id={id === '' ? undefined : id} className={`${cName}text text-s1`}>{ children }</h4>;
return <p id={id === '' ? undefined : id} className={`${cName}text text-${variant}`}>{ children }</p>;
}
Text.defaultProps = {
id: '',
className: '',
variant: 'b1',
};
Text.propTypes = {
id: PropTypes.string,
className: PropTypes.string,
variant: PropTypes.oneOf(['h1', 'h2', 's1', 'b1', 'b2', 'b3']),
children: PropTypes.node.isRequired,
};
export default Text;