Skip to content

Commit

Permalink
fix(component): fix Email component
Browse files Browse the repository at this point in the history
fix Email component with classes

resolves #39

Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
  • Loading branch information
niloysikdar committed Jul 3, 2022
1 parent c11c5aa commit a06231b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/components/Email/Email.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ Default.args = {
</tbody>
</table>
),
classes: {
email: {
backgroundColor: 'gray',
color: 'white',
},
},
};
16 changes: 13 additions & 3 deletions src/components/Email/Email.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import { CSSProperties, ReactNode } from 'react';
import { makeStyles } from '../../utils/makeStyles';

export interface EmailProps {
children?: ReactNode;
className?: string;
style?: CSSProperties;
classes?: { email?: CSSProperties };
}

export const Email = ({ children, className, style }: EmailProps): JSX.Element => {
const useStyles = makeStyles({
email: {
margin: '0px auto',
maxWidth: '600px',
},
});

export const Email = ({ children, className, classes }: EmailProps): JSX.Element => {
const styles = useStyles({ classes });

return (
<div style={{ margin: '0px auto', maxWidth: '600px', ...style }} className={className}>
<div style={styles.email} className={className}>
{children}
</div>
);
Expand Down

0 comments on commit a06231b

Please sign in to comment.