Skip to content

Commit

Permalink
Use flexbox for toast positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
timolins committed May 16, 2021
1 parent 273e29e commit 9381c26
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/components/toaster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,18 @@ const getPositionStyle = (
): React.CSSProperties => {
const top = position.includes('top');
const verticalStyle: React.CSSProperties = top ? { top: 0 } : { bottom: 0 };
const horizontalStyle: React.CSSProperties = position.includes('left')
const horizontalStyle: React.CSSProperties = position.includes('center')
? {
left: 0,
justifyContent: 'center',
}
: position.includes('right')
? {
right: 0,
justifyContent: 'flex-end',
}
: {
left: 0,
pointerEvents: 'none',
right: 0,
justifyContent: 'center',
};
: {};
return {
left: 0,
right: 0,
display: 'flex',
position: 'absolute',
transition: `all ${
Expand Down

0 comments on commit 9381c26

Please sign in to comment.