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

fixed node related item profile popout

This commit is contained in:
Fedor Katurov 2022-01-09 21:24:20 +07:00
parent 8311d3d43d
commit c0ece70f89
13 changed files with 106 additions and 186 deletions

View file

@ -4,9 +4,10 @@ import classNames from 'classnames';
import { INode } from '~/types';
import { PRESETS, URLS } from '~/constants/urls';
import { RouteComponentProps, withRouter } from 'react-router';
import { getURL } from '~/utils/dom';
import { getURL, getURLFromString } from '~/utils/dom';
import { Avatar } from '~/components/common/Avatar';
import { useColorGradientFromString } from '~/hooks/color/useColorGradientFromString';
import { Square } from '~/components/common/Square';
type IProps = RouteComponentProps & {
item: Partial<INode>;
@ -68,11 +69,13 @@ const NodeRelatedItemUnconnected: FC<IProps> = memo(({ item, history }) => {
onClick={onClick}
ref={ref}
>
<Avatar
username={item.title}
url={item.thumbnail}
className={classNames(styles.thumb, { [styles.is_loaded]: is_loaded })}
/>
{item.thumbnail && (
<Square
image={getURLFromString(item.thumbnail, 'avatar')}
onClick={onClick}
className={classNames(styles.thumb, { [styles.is_loaded]: is_loaded })}
/>
)}
{!item.thumbnail && size === 'small' && (
<div className={styles.letters} style={{ background }}>