mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-26 05:16:41 +07:00
Добавили заметки в сайдбар (#126)
* added notes sidebar * added note dropping and editing * added sidebar navigation * handling sidebarchanges over time * using router back for closing sidebar * fixed tripping inside single sidebar * added superpowers toggle to sidebar * user button opens sidebar now * added profile cover for profile sidebar * removed profile sidebar completely * ran prettier over project * added note not found error literal
This commit is contained in:
parent
fe3db608d6
commit
5d34090238
72 changed files with 1241 additions and 664 deletions
|
@ -3,7 +3,6 @@ import React, { FC, useCallback } from 'react';
|
|||
import { Avatar } from '~/components/common/Avatar';
|
||||
import { useUserDescription } from '~/hooks/auth/useUserDescription';
|
||||
import { INodeUser } from '~/types';
|
||||
import { openUserProfile } from '~/utils/user';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
|
@ -12,8 +11,6 @@ interface Props {
|
|||
}
|
||||
|
||||
const NodeAuthorBlock: FC<Props> = ({ user }) => {
|
||||
const onOpenProfile = useCallback(() => openUserProfile(user?.username), [user]);
|
||||
|
||||
const description = useUserDescription(user);
|
||||
|
||||
if (!user) {
|
||||
|
@ -23,7 +20,7 @@ const NodeAuthorBlock: FC<Props> = ({ user }) => {
|
|||
const { fullname, username, photo } = user;
|
||||
|
||||
return (
|
||||
<div className={styles.block} onClick={onOpenProfile}>
|
||||
<div className={styles.block}>
|
||||
<Avatar username={username} url={photo?.url} className={styles.avatar} />
|
||||
|
||||
<div className={styles.info}>
|
||||
|
|
|
@ -30,16 +30,19 @@ const NodeEditMenu: VFC<NodeEditMenuProps> = ({
|
|||
onLock,
|
||||
onEdit,
|
||||
}) => {
|
||||
const { isMobile } = useWindowSize();
|
||||
const { isTablet } = useWindowSize();
|
||||
|
||||
if (isMobile) {
|
||||
if (isTablet) {
|
||||
return (
|
||||
<MenuButton
|
||||
icon={<Icon icon="dots-vertical" className={styles.icon} size={24} />}
|
||||
className={className}
|
||||
>
|
||||
{canStar && (
|
||||
<MenuItemWithIcon icon={isHeroic ? 'star_full' : 'star'} onClick={onStar}>
|
||||
<MenuItemWithIcon
|
||||
icon={isHeroic ? 'star_full' : 'star'}
|
||||
onClick={onStar}
|
||||
>
|
||||
{isHeroic ? 'Убрать с главной' : 'На главную'}
|
||||
</MenuItemWithIcon>
|
||||
)}
|
||||
|
@ -48,7 +51,10 @@ const NodeEditMenu: VFC<NodeEditMenuProps> = ({
|
|||
Редактировать
|
||||
</MenuItemWithIcon>
|
||||
|
||||
<MenuItemWithIcon icon={isLocked ? 'locked' : 'unlocked'} onClick={onLock}>
|
||||
<MenuItemWithIcon
|
||||
icon={isLocked ? 'locked' : 'unlocked'}
|
||||
onClick={onLock}
|
||||
>
|
||||
{isLocked ? 'Восстановить' : 'Удалить'}
|
||||
</MenuItemWithIcon>
|
||||
</MenuButton>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue