mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-28 14:16:41 +07:00
removed redux completely
This commit is contained in:
parent
26e6d8d41b
commit
a4bb07e9cf
323 changed files with 2464 additions and 3348 deletions
|
@ -1,28 +1,25 @@
|
|||
import React, { FC, useCallback } from "react";
|
||||
import { Group } from "~/components/containers/Group";
|
||||
import styles from "./styles.module.scss";
|
||||
import { getURL } from "~/utils/dom";
|
||||
import { Icon } from "~/components/input/Icon";
|
||||
import { IUser } from "~/redux/auth/types";
|
||||
import { PRESETS } from "~/constants/urls";
|
||||
import { authOpenProfile } from "~/redux/auth/actions";
|
||||
import React, { FC, useCallback } from 'react';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import styles from './styles.module.scss';
|
||||
import { getURL } from '~/utils/dom';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { IUser } from '~/types/auth';
|
||||
import { PRESETS } from '~/constants/urls';
|
||||
|
||||
interface IProps {
|
||||
user: Partial<IUser>;
|
||||
onLogout: () => void;
|
||||
authOpenProfile: typeof authOpenProfile;
|
||||
authOpenProfile: () => void;
|
||||
}
|
||||
|
||||
const UserButton: FC<IProps> = ({ user: { username, photo }, authOpenProfile, onLogout }) => {
|
||||
const onProfileOpen = useCallback(() => {
|
||||
if (!username) return;
|
||||
authOpenProfile(username);
|
||||
}, [authOpenProfile, username]);
|
||||
authOpenProfile();
|
||||
}, [authOpenProfile]);
|
||||
|
||||
const onSettingsOpen = useCallback(() => {
|
||||
if (!username) return;
|
||||
authOpenProfile(username);
|
||||
}, [authOpenProfile, username]);
|
||||
authOpenProfile();
|
||||
}, [authOpenProfile]);
|
||||
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue