@@ -66,7 +66,9 @@ flex-direction: column; align-items: start; position: relative; - overflow: hidden; + overflow-y: hidden; + overflow-x: visible; + width: 250px; height: 250px; font: unset; @@ -1,43 +1,48 @@ import { PopupTemplate, getPopupById } from '#/shared/ui/popup' -import React from 'react' +import React, { Dispatch, SetStateAction } from 'react' import styles from './image-icons-popup.module.scss' import { Message } from '../types' import { CommonTooltip } from '#/shared/ui/tooltip' import { useImageIcons } from '../model' import BlankLinkSvg from '#/assets/svg/blank-link.svg?react' import DownloadSvg from '#/assets/svg/download.svg?react' +import { CSSTransition } from 'react-transition-group' -interface ImageIconsPopupProps extends Message {} - -export const ImageIconsPopup = ({ uid, file, content }: ImageIconsPopupProps) => { - const popup = getPopupById(uid) +interface ImageIconsPopupProps extends Message { + opened: boolean + setOpened: Dispatch> +} +export const ImageIconsPopup = ({ uid, file, content, opened, setOpened }: ImageIconsPopupProps) => { const { downloadFile } = useImageIcons() return ( - -
- - - - - - + +
+
+ Открыть в новой вкладке} position='left'> + + + + + +
- +
) } @@ -8,22 +8,27 @@ import GamburgerSvg from '#/assets/svg/gamburger.svg?react' import styles from './image-icons.module.scss' import { getPopupById } from '#/shared/ui/popup' import { ImageIconsPopup } from './image-icons-popup' +import { useState } from 'react' export interface ImageIconsProps extends Message {} export const ImageIcons = ({ uid, file, content, ...message }: ImageIconsProps) => { - const popup = getPopupById(uid) + const [opened, setOpened] = useState(false) return ( ) } @@ -5,13 +5,13 @@ border-radius: 9px; background: #ececff; color: var(--air-color); - padding: 6px 12px; + padding: 5px 10px; max-width: 340px; width: max-content; position: absolute; left: 50%; font-weight: 500; - z-index: 1; + z-index: 1000000; transition: all 0.3s ease-in-out; top: 140%; @@ -84,9 +84,10 @@ } &_left { + font-size: 13px; background-color: white; top: 50%; - right: 100%; + right: calc(100% + 20px); left: unset; padding: 12px 16px; transform: translateY(-50%) scale(0.9); @@ -25,7 +25,6 @@ export const Chats = ({ className, ...props }: ChatProps) => { fetchChats() return () => { - setCurrentChat(null) } }, []) @@ -7,6 +7,7 @@ border-radius: 15px; width: 30%; margin-left: 20px; + max-height: calc(100vh - 230px); @media screen and (max-width: 1000px) { width: 100%;