Skip to content

Commit

Permalink
fix(component): fix Preheader
Browse files Browse the repository at this point in the history
Fix Preheader styling props

resolves #63

Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
  • Loading branch information
niloysikdar committed Jul 16, 2022
1 parent d27b530 commit 26b2a4f
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions src/components/Preheader/Preheader.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
interface PreheaderProps {
import { makeStyles } from '../../utils/makeStyles';
import { BaseStyleProp } from '../types';

type PreheaderStyles = 'root';

export interface PreheaderProps extends BaseStyleProp<PreheaderStyles> {
text: string;
}

export const Preheader = ({ text }: PreheaderProps) => {
const useStyles = makeStyles({
root: {
display: 'none',
fontSize: '1px',
color: '#fff',
lineHeight: '1px',
maxHeight: 0,
maxWidth: 0,
opacity: 0,
overflow: 'hidden',
},
});

export const Preheader = ({ text, classes, className }: PreheaderProps) => {
const styles = useStyles({ classes });

return (
<div
style={{
display: 'none',
fontSize: '1px',
color: '#fff',
lineHeight: '1px',
maxHeight: 0,
maxWidth: 0,
opacity: 0,
overflow: 'hidden',
}}
>
<div style={styles.root} className={className}>
{text}
</div>
);
Expand Down

0 comments on commit 26b2a4f

Please sign in to comment.