diff --git a/src/components/Inbox/DialogCard.module.scss b/src/components/Inbox/DialogCard.module.scss index 0bd82c0f..e2011b68 100644 --- a/src/components/Inbox/DialogCard.module.scss +++ b/src/components/Inbox/DialogCard.module.scss @@ -9,7 +9,7 @@ cursor: pointer; width: 100%; - &:hover { + &.hovered:hover { background: #f7f7f7; } @@ -69,4 +69,14 @@ } } } + + &.opened, + &.opened:hover { + background: #000; + .name, + .message, + .time { + color: #fff !important; + } + } } diff --git a/src/components/Inbox/DialogCard.tsx b/src/components/Inbox/DialogCard.tsx index fc804bb8..be6a9b1b 100644 --- a/src/components/Inbox/DialogCard.tsx +++ b/src/components/Inbox/DialogCard.tsx @@ -16,6 +16,7 @@ type DialogProps = { onClick?: () => void isChatHeader?: boolean lastUpdate?: number + isOpened?: boolean } const DialogCard = (props: DialogProps) => { @@ -27,10 +28,16 @@ const DialogCard = (props: DialogProps) => { ?.map((companion) => companion.name) .join(', ') ) - return ( -
+
}> 2}> diff --git a/src/components/Inbox/Message.module.scss b/src/components/Inbox/Message.module.scss index 1c9e3d75..0dd8ea1d 100644 --- a/src/components/Inbox/Message.module.scss +++ b/src/components/Inbox/Message.module.scss @@ -2,6 +2,7 @@ display: flex; flex-direction: column; margin: 3.2rem 0; + position: relative; .body { background: #f6f6f6; diff --git a/src/components/Inbox/Message.tsx b/src/components/Inbox/Message.tsx index b7e54a93..b317ae2d 100644 --- a/src/components/Inbox/Message.tsx +++ b/src/components/Inbox/Message.tsx @@ -5,6 +5,7 @@ import styles from './Message.module.scss' import DialogAvatar from './DialogAvatar' import type { Message, ChatMember } from '../../graphql/types.gen' import formattedTime from '../../utils/formatDateTime' +import { Icon } from '../_shared/Icon' type Props = { content: Message @@ -17,11 +18,13 @@ const md = new MarkdownIt({ }) const Message = (props: Props) => { - // возвращать ID автора const isOwn = props.ownId === Number(props.content.author) const user = props.members?.find((m) => m.id === Number(props.content.author)) return (
+ {/*
*/} + {/* /!**!/*/} + {/*
*/}
diff --git a/src/components/Views/Inbox.tsx b/src/components/Views/Inbox.tsx index b4b8b837..c36b149b 100644 --- a/src/components/Views/Inbox.tsx +++ b/src/components/Views/Inbox.tsx @@ -17,7 +17,6 @@ import DialogHeader from '../Inbox/DialogHeader' import { apiClient } from '../../utils/apiClient' import MessagesFallback from '../Inbox/MessagesFallback' import { useRouter } from '../../stores/router' -import createChat from '../../graphql/mutation/create-chat' const userSearch = (array: Author[], keyword: string) => { const searchTerm = keyword.toLowerCase() @@ -144,43 +143,46 @@ export const InboxView = () => {
-
-
    -
  • { - setSortByPerToPer(false) - setSortByGroup(false) - }} - > - {t('All')} -
  • -
  • { - setSortByPerToPer(true) - setSortByGroup(false) - }} - > - {t('Personal')} -
  • -
  • { - setSortByGroup(true) - setSortByPerToPer(false) - }} - > - {t('Groups')} -
  • -
-
+ +
+
    +
  • { + setSortByPerToPer(false) + setSortByGroup(false) + }} + > + {t('All')} +
  • +
  • { + setSortByPerToPer(true) + setSortByGroup(false) + }} + > + {t('Personal')} +
  • +
  • { + setSortByGroup(true) + setSortByPerToPer(false) + }} + > + {t('Groups')} +
  • +
+
+
{(chat) => ( handleOpenChat(chat)} + isOpened={chat.id === currentDialog()?.id} title={chat.title || chat.members[0].name} members={chat.members} ownId={currentUserId()} diff --git a/src/styles/Inbox.scss b/src/styles/Inbox.scss index c35cc6a8..bec189ca 100644 --- a/src/styles/Inbox.scss +++ b/src/styles/Inbox.scss @@ -57,7 +57,7 @@ main { content: ''; position: absolute; width: 100%; - right: 10px; + right: 0; z-index: 1; height: $fade-height; }