Skip to content

Commit

Permalink
Use React.CSSProperties instead csstype
Browse files Browse the repository at this point in the history
  • Loading branch information
timolins committed Mar 22, 2021
1 parent 2be3b23 commit e58d6a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/components/toaster.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';
import { CSSAttribute, setup } from 'goober';
import CSS from 'csstype';
import { setup } from 'goober';

import { useToaster } from '../core/use-toaster';
import { ToastBar } from './toast-bar';
Expand All @@ -14,8 +13,8 @@ const getPositionStyle = (
offset: number
): React.CSSProperties => {
const top = position.includes('top');
const verticalStyle: CSSAttribute = top ? { top: 0 } : { bottom: 0 };
const horizontalStyle: CSSAttribute = position.includes('left')
const verticalStyle: React.CSSProperties = top ? { top: 0 } : { bottom: 0 };
const horizontalStyle: React.CSSProperties = position.includes('left')
? {
left: 0,
}
Expand All @@ -42,7 +41,7 @@ const getPositionStyle = (
interface ToasterProps {
position?: ToastPosition;
reverseOrder?: boolean;
containerStyle?: CSS.Properties;
containerStyle?: React.CSSProperties;
containerClassName?: string;

toastOptions?: DefaultToastOptions;
Expand Down
4 changes: 2 additions & 2 deletions src/core/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Properties } from 'csstype';
import { CSSProperties } from 'react';

export type ToastType = 'success' | 'error' | 'loading' | 'blank';
export type ToastPosition =
Expand Down Expand Up @@ -43,7 +43,7 @@ export interface Toast {
role: 'status' | 'alert';
ariaLive: 'assertive' | 'off' | 'polite';

style?: Properties;
style?: CSSProperties;
className?: string;
iconTheme?: IconTheme;

Expand Down

0 comments on commit e58d6a8

Please sign in to comment.