From 03fd10d0681b1399968b49cbc67d8dbd4a57d134 Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Mon, 23 Dec 2019 11:01:09 +0100 Subject: [PATCH] Merge branch 'master' of https://github.com/tootsuite/mastodon into messaging :zap: add snow effect conditionnally # Conflicts: # package.json # yarn.lock --- .../features/ui/components/link_footer.js | 17 +++++++++++ .../mastodon/utils/snowstorm-min.js | 29 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 app/javascript/mastodon/utils/snowstorm-min.js diff --git a/app/javascript/mastodon/features/ui/components/link_footer.js b/app/javascript/mastodon/features/ui/components/link_footer.js index b77492724..27f3107e9 100644 --- a/app/javascript/mastodon/features/ui/components/link_footer.js +++ b/app/javascript/mastodon/features/ui/components/link_footer.js @@ -29,9 +29,13 @@ class LinkFooter extends React.PureComponent { static propTypes = { withHotkeys: PropTypes.bool, + displaySnow: PropTypes.bool, onLogout : PropTypes.func.isRequired, intl : PropTypes.object.isRequired, }; + static defaultProps = { + displaySnow: false, + }; handleLogoutClick = e => { e.preventDefault(); @@ -42,11 +46,24 @@ class LinkFooter extends React.PureComponent { return false; }; + componentDidMount() { + // make snow effect + if (this.props.displaySnow) { + import('../../../utils/snowstorm-min') + .then((snowstorm) => { + console.log(snowstorm); + snowstorm(window, document); + }) + .catch((err) => console.error(err)); + } + } + render() { const { withHotkeys } = this.props; return (
+