mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
universal backdrop component
This commit is contained in:
parent
327272a08a
commit
f781ecc6aa
4 changed files with 6 additions and 4 deletions
|
@ -9,7 +9,7 @@ interface IProps {
|
|||
cover: IUser['cover'];
|
||||
}
|
||||
|
||||
const ProfileBackdrop: FC<IProps> = ({ cover }) => {
|
||||
const CoverBackdrop: FC<IProps> = ({ cover }) => {
|
||||
const [is_loaded, setIsLoaded] = useState(false);
|
||||
|
||||
const onLoad = useCallback(() => setIsLoaded(true), [setIsLoaded]);
|
||||
|
@ -32,4 +32,4 @@ const ProfileBackdrop: FC<IProps> = ({ cover }) => {
|
|||
);
|
||||
};
|
||||
|
||||
export { ProfileBackdrop };
|
||||
export { CoverBackdrop };
|
|
@ -15,6 +15,7 @@ import { selectUploads } from '~/redux/uploads/selectors';
|
|||
import { ERROR_LITERAL } from '~/constants/errors';
|
||||
import { NODE_EDITORS, EMPTY_NODE } from '~/redux/node/constants';
|
||||
import { BetterScrollDialog } from '../BetterScrollDialog';
|
||||
import { CoverBackdrop } from '~/components/containers/CoverBackdrop';
|
||||
|
||||
const mapStateToProps = state => {
|
||||
const { editor, errors } = selectNode(state);
|
||||
|
@ -93,6 +94,7 @@ const EditorDialogUnconnected: FC<IProps> = ({
|
|||
<form onSubmit={onSubmit} className={styles.form}>
|
||||
<BetterScrollDialog
|
||||
footer={buttons}
|
||||
backdrop={<CoverBackdrop cover={data.cover} />}
|
||||
width={860}
|
||||
error={error && ERROR_LITERAL[error]}
|
||||
onClose={onRequestClose}
|
||||
|
|
|
@ -9,7 +9,7 @@ import { ProfileDescription } from '~/components/profile/ProfileDescription';
|
|||
import * as AUTH_ACTIONS from '~/redux/auth/actions';
|
||||
import { IAuthState } from '~/redux/auth/types';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { ProfileBackdrop } from '~/components/profile/ProfileBackdrop';
|
||||
import { CoverBackdrop } from '~/components/containers/CoverBackdrop';
|
||||
|
||||
const TAB_CONTENT = {
|
||||
profile: <ProfileDescription />,
|
||||
|
@ -49,7 +49,7 @@ const ProfileDialogUnconnected: FC<IProps> = ({
|
|||
setTab={setTab}
|
||||
/>
|
||||
}
|
||||
backdrop={<ProfileBackdrop cover={user && user.cover} />}
|
||||
backdrop={<CoverBackdrop cover={user && user.cover} />}
|
||||
onClose={onRequestClose}
|
||||
>
|
||||
{TAB_CONTENT[tab] || null}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue