hide default content conponent if hidePresentation and autoSwapLayout

This commit is contained in:
KDSBrowne 2020-05-12 14:42:34 +00:00
parent 851e63f557
commit 321d2cbd37
2 changed files with 37 additions and 24 deletions

View File

@ -1,33 +1,42 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { TransitionGroup, CSSTransition } from 'react-transition-group';
import cx from 'classnames';
import { styles } from './styles.scss';
export default () => (
<TransitionGroup>
<CSSTransition
classNames={{
const LAYOUT_CONFIG = Meteor.settings.public.layout;
export default () => {
const { autoSwapLayout, hidePresentation } = LAYOUT_CONFIG;
return (
<TransitionGroup>
<CSSTransition
classNames={{
appear: styles.appear,
appearActive: styles.appearActive,
}}
appear
enter={false}
exit={false}
timeout={{ enter: 400 }}
className={styles.contentWrapper}
>
<div className={styles.content}>
<div className={styles.defaultContent}>
<p>
<FormattedMessage
id="app.home.greeting"
description="Message to greet the user."
defaultMessage="Your presentation will begin shortly..."
/>
<br />
</p>
appear
enter={false}
exit={false}
timeout={{ enter: 400 }}
className={styles.contentWrapper}
>
<div className={styles.content}>
<div className={cx(styles.defaultContent, {
[styles.hideContent]: autoSwapLayout && hidePresentation,
})}
>
<p>
<FormattedMessage
id="app.home.greeting"
description="Message to greet the user."
defaultMessage="Your presentation will begin shortly..."
/>
<br />
</p>
</div>
</div>
</div>
</CSSTransition>
</TransitionGroup>
);
</CSSTransition>
</TransitionGroup>
);
};

View File

@ -36,6 +36,10 @@
overflow: auto;
}
.hideContent {
visibility: hidden;
}
.appear {
opacity: 0.01;
}