Skip to content

Commit

Permalink
fix(types): fix types props for Email
Browse files Browse the repository at this point in the history
fix types using Record and add styles to the prop for Email component

resolves #39

Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
  • Loading branch information
niloysikdar committed Jul 3, 2022
1 parent a06231b commit 83d8a9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/Email/Email.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Default.args = {
</tbody>
</table>
),
classes: {
styles: {
email: {
backgroundColor: 'gray',
color: 'white',
Expand Down
8 changes: 4 additions & 4 deletions src/components/Email/Email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { makeStyles } from '../../utils/makeStyles';
export interface EmailProps {
children?: ReactNode;
className?: string;
classes?: { email?: CSSProperties };
styles?: Record<'email', CSSProperties>;
}

const useStyles = makeStyles({
Expand All @@ -14,11 +14,11 @@ const useStyles = makeStyles({
},
});

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

return (
<div style={styles.email} className={className}>
<div style={style.email} className={className}>
{children}
</div>
);
Expand Down

0 comments on commit 83d8a9b

Please sign in to comment.