mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
cleaned profile page
This commit is contained in:
parent
2bd2ba079c
commit
4d73f18843
4 changed files with 35 additions and 58 deletions
|
@ -1,54 +0,0 @@
|
|||
import React, { FC, useEffect } from 'react';
|
||||
import styles from './styles.module.scss';
|
||||
import { ProfilePageLeft } from '../ProfilePageLeft';
|
||||
import { Switch, Route, RouteComponentProps } from 'react-router';
|
||||
import { IState } from '~/redux/store';
|
||||
import { selectAuthProfile } from '~/redux/auth/selectors';
|
||||
import { connect } from 'react-redux';
|
||||
import * as AUTH_ACTIONS from '~/redux/auth/actions';
|
||||
|
||||
const mapStateToProps = (state: IState) => ({
|
||||
profile: selectAuthProfile(state),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = {
|
||||
authLoadProfile: AUTH_ACTIONS.authLoadProfile,
|
||||
};
|
||||
|
||||
type Props = ReturnType<typeof mapStateToProps> &
|
||||
typeof mapDispatchToProps &
|
||||
RouteComponentProps<{ username: string }> & {};
|
||||
|
||||
const ProfilePageUnconnected: FC<Props> = ({
|
||||
profile,
|
||||
authLoadProfile,
|
||||
match: {
|
||||
params: { username },
|
||||
},
|
||||
}) => {
|
||||
useEffect(() => {
|
||||
authLoadProfile(username);
|
||||
}, [username]);
|
||||
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
<div className={styles.right}>
|
||||
<Switch>
|
||||
<Route path="/profile/:username" render={() => <div>DEFAULT</div>} />
|
||||
<Route path="/profile/:username/tab" render={() => <div>TAB</div>} />
|
||||
</Switch>
|
||||
</div>
|
||||
|
||||
<div className={styles.left}>
|
||||
<ProfilePageLeft profile={profile} username={username} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const ProfilePage = connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ProfilePageUnconnected);
|
||||
|
||||
export { ProfilePage };
|
|
@ -1,22 +0,0 @@
|
|||
@import "src/styles/variables";
|
||||
|
||||
.wrap {
|
||||
flex: 1;
|
||||
background: $content_bg;
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
justify-content: stretch;
|
||||
box-shadow: $node_shadow;
|
||||
border-radius: $radius;
|
||||
}
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
background: darken($content_bg, 2%);
|
||||
border-radius: 0 $radius $radius 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.right {
|
||||
flex: 4;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue