Skip to content

Commit

Permalink
fix(component): fix types and props name
Browse files Browse the repository at this point in the history
fix types with extends BaseStyleProp and adding classes to the props list

resolves #39

Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
  • Loading branch information
niloysikdar committed Jul 4, 2022
1 parent 579f073 commit f8368a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/components/Email/Email.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Default.args = {
</tbody>
</table>
),
styles: {
email: {
classes: {
root: {
backgroundColor: 'gray',
color: 'white',
},
Expand Down
17 changes: 9 additions & 8 deletions src/components/Email/Email.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import { CSSProperties, ReactNode } from 'react';
import { ReactNode } from 'react';
import { BaseStyleProp } from '../types';
import { makeStyles } from '../../utils/makeStyles';

export interface EmailProps {
type EmailStyles = 'root';

export interface EmailProps extends BaseStyleProp<EmailStyles> {
children?: ReactNode;
className?: string;
styles?: Record<'email', CSSProperties>;
}

const useStyles = makeStyles({
email: {
root: {
margin: '0px auto',
maxWidth: '600px',
},
});

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

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

0 comments on commit f8368a7

Please sign in to comment.