1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 21:06:42 +07:00

removed profile redux items

This commit is contained in:
Fedor Katurov 2022-01-08 18:01:38 +07:00
parent 5b28313afd
commit 3c0571816c
55 changed files with 488 additions and 710 deletions

View file

@ -1,10 +1,8 @@
import React, { FC, useEffect } from "react";
import React, { FC } from "react";
import styles from "./styles.module.scss";
import { RouteComponentProps } from "react-router";
import { useDispatch } from "react-redux";
import { authLoadProfile } from "~/redux/auth/actions";
import { useShallowSelect } from "~/hooks/data/useShallowSelect";
import { selectAuthProfile, selectUser } from "~/redux/auth/selectors";
import { selectUser } from "~/redux/auth/selectors";
import { ProfilePageLeft } from "~/containers/profile/ProfilePageLeft";
import { Container } from "~/containers/main/Container";
import { FlowGrid } from "~/components/flow/FlowGrid";
@ -12,6 +10,7 @@ import { ProfilePageStats } from "~/containers/profile/ProfilePageStats";
import { Card } from "~/components/containers/Card";
import { useFlowStore } from "~/store/flow/useFlowStore";
import { observer } from "mobx-react";
import { useGetProfile } from "~/hooks/profile/useGetProfile";
type Props = RouteComponentProps<{ username: string }> & {};
@ -23,26 +22,19 @@ const ProfileLayout: FC<Props> = observer(
}) => {
const { nodes } = useFlowStore();
const user = useShallowSelect(selectUser);
const dispatch = useDispatch();
useEffect(() => {
dispatch(authLoadProfile(username));
}, [dispatch, username]);
const profile = useShallowSelect(selectAuthProfile);
const { profile, isLoading } = useGetProfile(username);
return (
<Container className={styles.wrap}>
<div className={styles.grid}>
<div className={styles.stamp}>
<div className={styles.row}>
<ProfilePageLeft profile={profile} username={username} />
<ProfilePageLeft profile={profile} username={username} isLoading={isLoading} />
</div>
{!!profile.user?.description && (
{!!profile?.description && (
<div className={styles.row}>
<Card className={styles.description}>{profile.user.description}</Card>
<Card className={styles.description}>{profile.description}</Card>
</div>
)}