1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

removed search reducer completely

This commit is contained in:
Fedor Katurov 2022-01-04 15:51:44 +07:00
parent 38eedab3c2
commit b82ccfb786
22 changed files with 146 additions and 570 deletions

View file

@ -9,53 +9,56 @@ import { ProfilePageLeft } from '~/containers/profile/ProfilePageLeft';
import { Container } from '~/containers/main/Container';
import { FlowGrid } from '~/components/flow/FlowGrid';
import { Sticky } from '~/components/containers/Sticky';
import { selectFlow } from '~/redux/flow/selectors';
import { ProfilePageStats } from '~/containers/profile/ProfilePageStats';
import { Card } from '~/components/containers/Card';
import { useFlowStore } from '~/store/flow/useFlowStore';
import { observer } from 'mobx-react';
type Props = RouteComponentProps<{ username: string }> & {};
const ProfileLayout: FC<Props> = ({
match: {
params: { username },
},
}) => {
const { nodes } = useShallowSelect(selectFlow);
const user = useShallowSelect(selectUser);
const ProfileLayout: FC<Props> = observer(
({
match: {
params: { username },
},
}) => {
const { nodes } = useFlowStore();
const user = useShallowSelect(selectUser);
const dispatch = useDispatch();
const dispatch = useDispatch();
useEffect(() => {
dispatch(authLoadProfile(username));
}, [dispatch, username]);
useEffect(() => {
dispatch(authLoadProfile(username));
}, [dispatch, username]);
const profile = useShallowSelect(selectAuthProfile);
const profile = useShallowSelect(selectAuthProfile);
return (
<Container className={styles.wrap}>
<div className={styles.left}>
<Sticky>
<div className={styles.row}>
<ProfilePageLeft profile={profile} username={username} />
</div>
{!!profile.user?.description && (
return (
<Container className={styles.wrap}>
<div className={styles.left}>
<Sticky>
<div className={styles.row}>
<Card className={styles.description}>{profile.user.description}</Card>
<ProfilePageLeft profile={profile} username={username} />
</div>
)}
<div className={styles.row}>
<ProfilePageStats />
</div>
</Sticky>
</div>
{!!profile.user?.description && (
<div className={styles.row}>
<Card className={styles.description}>{profile.user.description}</Card>
</div>
)}
<div className={styles.grid}>
<FlowGrid nodes={nodes} user={user} onChangeCellView={console.log} />
</div>
</Container>
);
};
<div className={styles.row}>
<ProfilePageStats />
</div>
</Sticky>
</div>
<div className={styles.grid}>
<FlowGrid nodes={nodes} user={user} onChangeCellView={console.log} />
</div>
</Container>
);
}
);
export { ProfileLayout };