mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
fixed profile patching
This commit is contained in:
parent
f25d627b4e
commit
60dffc2353
6 changed files with 209 additions and 60 deletions
|
@ -1,12 +1,13 @@
|
|||
import React, { FC } from 'react';
|
||||
import { IUser } from '~/redux/auth/types';
|
||||
import styles from './styles.scss';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { Placeholder } from '~/components/placeholders/Placeholder';
|
||||
import { getURL, getPrettyDate } from '~/utils/dom';
|
||||
import { PRESETS } from '~/constants/urls';
|
||||
import { ProfileTabs } from '../ProfileTabs';
|
||||
import { MessageForm } from '~/components/profile/MessageForm';
|
||||
import React, { FC } from "react";
|
||||
import { IUser } from "~/redux/auth/types";
|
||||
import styles from "./styles.scss";
|
||||
import { Group } from "~/components/containers/Group";
|
||||
import { Placeholder } from "~/components/placeholders/Placeholder";
|
||||
import { getURL, getPrettyDate } from "~/utils/dom";
|
||||
import { PRESETS } from "~/constants/urls";
|
||||
import { ProfileTabs } from "../ProfileTabs";
|
||||
import { MessageForm } from "~/components/profile/MessageForm";
|
||||
import { ProfileAvatar } from "../ProfileAvatar";
|
||||
|
||||
interface IProps {
|
||||
user?: IUser;
|
||||
|
@ -19,24 +20,21 @@ interface IProps {
|
|||
}
|
||||
|
||||
const TAB_HEADERS = {
|
||||
messages: <MessageForm is_sending_message={false} />,
|
||||
messages: <MessageForm is_sending_message={false} />
|
||||
};
|
||||
|
||||
const ProfileInfo: FC<IProps> = ({ user, tab, is_loading, is_own, setTab }) => (
|
||||
<div>
|
||||
<Group className={styles.wrap} horizontal>
|
||||
<div
|
||||
className={styles.avatar}
|
||||
style={{
|
||||
backgroundImage: is_loading
|
||||
? null
|
||||
: `url("${user && getURL(user.photo, PRESETS.avatar)}")`,
|
||||
}}
|
||||
/>
|
||||
<ProfileAvatar />
|
||||
|
||||
<div className={styles.field}>
|
||||
<div className={styles.name}>
|
||||
{is_loading ? <Placeholder width="80%" /> : user.fullname || user.username}
|
||||
{is_loading ? (
|
||||
<Placeholder width="80%" />
|
||||
) : (
|
||||
user.fullname || user.username
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className={styles.description}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue