Skip to content

Commit

Permalink
Extract default offset to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
timolins committed May 16, 2021
1 parent 9381c26 commit ff9a762
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/toaster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ interface ToasterProps {
toastOptions?: DefaultToastOptions;
renderToast?: (toast: Toast) => JSX.Element;
}
const DEFAULT_OFFSET = 16;

export const Toaster: React.FC<ToasterProps> = ({
reverseOrder,
position = 'top-center',
gutter,
containerStyle,
toastOptions,
containerClassName,
Expand All @@ -66,13 +68,13 @@ export const Toaster: React.FC<ToasterProps> = ({
return (
<div
style={{
top: 16,
left: 16,
right: 16,
bottom: 16,
position: 'fixed',
zIndex: 9999,
top: DEFAULT_OFFSET,
left: DEFAULT_OFFSET,
right: DEFAULT_OFFSET,
bottom: DEFAULT_OFFSET,
pointerEvents: 'none',
position: 'fixed',
...containerStyle,
}}
className={containerClassName}
Expand Down

0 comments on commit ff9a762

Please sign in to comment.