Merge pull request #14578 from JoVictorNunes/issue-14443

fix: toast notification style
This commit is contained in:
Anton Georgiev 2022-03-31 10:46:59 -04:00 committed by GitHub
commit c89f952868
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 19 deletions

View File

@ -27,7 +27,6 @@ import {
borderSizeSmall,
toastIconMd,
toastIconSm,
smPaddingY,
jumboPaddingY,
} from '/imports/ui/stylesheets/styled-components/general';
import { smallOnly } from '/imports/ui/stylesheets/styled-components/breakpoints';
@ -180,7 +179,6 @@ const Toast = styled.div`
const ToastifyContainer = styled(Toastify)`
z-index: 9998;
position: fixed;
padding: ${smPaddingY};
min-width: 20rem !important;
max-width: 23rem !important;
box-sizing: border-box;

View File

@ -175,27 +175,14 @@ class Presentation extends PureComponent {
politeSRAlert(intl.formatMessage(intlMessages.slideContentChanged, { 0: currentSlide.num }));
}
if (prevProps?.slidePosition && slidePosition) {
const { width: prevWidth, height: prevHeight } = prevProps.slidePosition;
const { width: currWidth, height: currHeight } = slidePosition;
if (prevWidth !== currWidth || prevHeight !== currHeight) {
layoutContextDispatch({
type: ACTIONS.SET_PRESENTATION_CURRENT_SLIDE_SIZE,
value: {
width: currWidth,
height: currHeight,
},
});
}
const downloadableOn = !prevProps.currentPresentation.downloadable
if (currentPresentation) {
const downloadableOn = !prevProps?.currentPresentation?.downloadable
&& currentPresentation.downloadable;
const shouldCloseToast = !(currentPresentation.downloadable && !userIsPresenter);
if (
prevProps.currentPresentation.name !== currentPresentation.name
prevProps?.currentPresentation?.name !== currentPresentation.name
|| (downloadableOn && !userIsPresenter)
) {
if (this.currentPresentationToastId) {
@ -212,7 +199,7 @@ class Presentation extends PureComponent {
}
}
const downloadableOff = prevProps.currentPresentation.downloadable
const downloadableOff = prevProps?.currentPresentation?.downloadable
&& !currentPresentation.downloadable;
if (this.currentPresentationToastId && downloadableOff) {
@ -221,6 +208,21 @@ class Presentation extends PureComponent {
render: this.renderCurrentPresentationToast(),
});
}
}
if (prevProps?.slidePosition && slidePosition) {
const { width: prevWidth, height: prevHeight } = prevProps.slidePosition;
const { width: currWidth, height: currHeight } = slidePosition;
if (prevWidth !== currWidth || prevHeight !== currHeight) {
layoutContextDispatch({
type: ACTIONS.SET_PRESENTATION_CURRENT_SLIDE_SIZE,
value: {
width: currWidth,
height: currHeight,
},
});
}
if (layoutSwapped && restoreOnUpdate && !userIsPresenter && currentSlide) {
const slideChanged = currentSlide.id !== prevProps.currentSlide.id;

View File

@ -143,6 +143,9 @@ const GlobalStyle = createGlobalStyle`
.actionToast {
background-color: ${colorWhite};
display: flex;
padding: ${smPaddingX};
border-radius: ${borderRadius};
i.close {
left: none !important;