From f79727a8632490f11c1423773fdd6adfb6337a7b Mon Sep 17 00:00:00 2001 From: muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com> Date: Tue, 25 Oct 2022 12:51:28 +0530 Subject: Transform 'AuthLayoutContainer' component hierarchy to tsx (#699) Co-authored-by: Muhamed <> Co-authored-by: Vijay A --- src/components/ui/InfoBar.tsx | 89 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/components/ui/InfoBar.tsx (limited to 'src/components/ui/InfoBar.tsx') diff --git a/src/components/ui/InfoBar.tsx b/src/components/ui/InfoBar.tsx new file mode 100644 index 000000000..ef8f6ad6f --- /dev/null +++ b/src/components/ui/InfoBar.tsx @@ -0,0 +1,89 @@ +import { Component, MouseEventHandler, ReactNode } from 'react'; +import { observer } from 'mobx-react'; +import classnames from 'classnames'; +import Loader from 'react-loader'; +import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl'; + +import { mdiClose } from '@mdi/js'; +import { noop } from 'lodash'; +import Appear from './effects/Appear'; +import Icon from './icon'; + +const messages = defineMessages({ + hide: { + id: 'infobar.hide', + defaultMessage: 'Hide', + }, +}); + +interface IProps extends WrappedComponentProps { + children: ReactNode; + onClick?: MouseEventHandler; + type?: string; + className?: string; + ctaLabel?: string; + ctaLoading?: boolean; + position?: string; + sticky?: boolean; + onHide?: () => void; +} + +@observer +class InfoBar extends Component { + render() { + const { + children, + type = 'primary', + onClick = noop, + className = '', + ctaLabel = '', + ctaLoading = false, + position = 'bottom', + sticky = false, + onHide = noop, + intl, + } = this.props; + + const transitionName = position === 'top' ? 'slideDown' : 'slideUp'; + + return ( + +
+ {children} + {ctaLabel && ( + + )} +
+ {!sticky && ( + + )} +
+ ); + } +} + +export default injectIntl(InfoBar); -- cgit v1.2.3-54-g00ecf