mirror of
https://github.com/prymitive/karma
synced 2026-05-09 03:36:44 +00:00
This library is not maintained anymore and it causes small glitches when rendering a lot of alerts - scrolling groups into view doesn't always trigger animation and they stay hidden.
28 lines
620 B
JavaScript
28 lines
620 B
JavaScript
import React from "react";
|
|
|
|
import { CSSTransition } from "react-transition-group";
|
|
|
|
import { ThemeContext } from "Components/Theme";
|
|
|
|
const CenteredMessage = ({ children, className }) => {
|
|
const context = React.useContext(ThemeContext);
|
|
return (
|
|
<CSSTransition
|
|
in={true}
|
|
appear={true}
|
|
classNames="components-animation-fade"
|
|
timeout={context.animations.duration}
|
|
>
|
|
<h1
|
|
className={`${
|
|
className ? className : "display-1 text-placeholder"
|
|
} screen-center`}
|
|
>
|
|
{children}
|
|
</h1>
|
|
</CSSTransition>
|
|
);
|
|
};
|
|
|
|
export { CenteredMessage };
|