mirror of
https://github.com/wassname/talk.git
synced 2026-07-02 13:24:47 +08:00
19 lines
407 B
JavaScript
19 lines
407 B
JavaScript
import React from 'react';
|
|
import styles from './SnackBar.css';
|
|
|
|
const SnackBar = ({ children, className, position, ...attrs }) => {
|
|
return (
|
|
<div
|
|
className={`${styles.SnackBar} ${className}`}
|
|
style={position ? { top: `${position}px` } : fixedStyle}
|
|
{...attrs}
|
|
>
|
|
{children}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
const fixedStyle = { bottom: '200px', top: 'auto' };
|
|
|
|
export default SnackBar;
|