Skip to content

Commit

Permalink
ToastList: wrap in root portal (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
AquiGorka authored and bpierre committed Nov 18, 2019
1 parent c4003fc commit 1e0ca18
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/components/ToastHub/ToastHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useContext } from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import { animated, Transition } from 'react-spring'
import RootPortal from '../RootPortal/RootPortal'
import { stylingProps } from '../../utils'
import { useTheme } from '../../theme'
import { springs, textStyle, GU, RADIUS } from '../../style'
Expand Down Expand Up @@ -95,17 +96,19 @@ class ToastHubProvider extends React.PureComponent {
<React.Fragment>
<Provider value={this.add}>{children}</Provider>
{showList && (
<ToastList
config={this.config}
items={this.state.items}
leave={this.leave}
position={position}
remove={this.remove}
showIndicator={showIndicator}
top={top}
{...stylingProps(this)}
shift={shift}
/>
<RootPortal>
<ToastList
config={this.config}
items={this.state.items}
leave={this.leave}
position={position}
remove={this.remove}
showIndicator={showIndicator}
top={top}
{...stylingProps(this)}
shift={shift}
/>
</RootPortal>
)}
</React.Fragment>
)
Expand Down

0 comments on commit 1e0ca18

Please sign in to comment.