diff --git a/src/common/component/CurrentUser.js b/src/common/component/CurrentUser.js index cd5aa432..faeb461c 100644 --- a/src/common/component/CurrentUser.js +++ b/src/common/component/CurrentUser.js @@ -1,12 +1,10 @@ import { useEffect } from "react"; import styled from "styled-components"; -import { AiOutlineCaretDown, AiOutlineSound } from "react-icons/ai"; -import { MdOutlineKeyboardVoice } from "react-icons/md"; import { useSelector, useDispatch } from "react-redux"; import { useNavigate } from "react-router-dom"; import { clearAuthData } from "../../app/slices/auth.data"; -import BASE_URL from "../../app/config"; +// import BASE_URL from "../../app/config"; import { useLazyLogoutQuery } from "../../app/services/auth"; import Avatar from "./Avatar"; const StyledWrapper = styled.div` @@ -14,8 +12,10 @@ const StyledWrapper = styled.div` position: absolute; bottom: 0; left: 0; - padding: 16px 12px; - width: 100%; + margin: 8px; + width: -webkit-fill-available; + border-radius: 25px; + padding: 7px 8px 7px 4px; display: flex; align-items: center; justify-content: space-between; @@ -26,12 +26,28 @@ const StyledWrapper = styled.div` justify-content: space-between; gap: 5px; .avatar { - width: 24px; - height: 24px; + width: 32px; + height: 32px; border-radius: 50%; } .toggle { } + .info { + display: flex; + flex-direction: column; + .name { + font-weight: bold; + font-size: 14px; + line-height: 20px; + color: #27272a; + } + .id { + padding: 0 2px; + font-size: 12px; + line-height: 18px; + color: #52525b; + } + } } .settings { gap: 20px; @@ -40,6 +56,8 @@ const StyledWrapper = styled.div` justify-content: space-between; .icon { cursor: pointer; + width: 24px; + height: 24px; } } `; @@ -59,24 +77,34 @@ export default function CurrentUser({ expand = true }) { }, [isSuccess]); if (!user) return null; - const { name, avatar } = user; + const { uid, name, avatar } = user; return ( -
+
- +
+ {name} + #{uid} +
{expand && (
- - + mic icon + sound icon
)} diff --git a/src/common/component/Message/index.js b/src/common/component/Message/index.js index cd9aee8a..b9b9c364 100644 --- a/src/common/component/Message/index.js +++ b/src/common/component/Message/index.js @@ -1,12 +1,12 @@ import { useEffect, useRef } from "react"; import dayjs from "dayjs"; -import { useDispatch } from "react-redux"; +import { useDispatch, useSelector } from "react-redux"; import { useInViewRef } from "rooks"; import Tippy from "@tippyjs/react"; +import Linkify from "react-linkify"; import Profile from "../Profile"; import Avatar from "../Avatar"; import BASE_URL from "../../../app/config"; -import { useGetContactsQuery } from "../../../app/services/contact"; import { setChannelMsgRead } from "../../../app/slices/message.channel"; import { setUserMsgRead } from "../../../app/slices/message.user"; import StyledWrapper from "./styled"; @@ -15,7 +15,17 @@ const renderContent = (type, content) => { let ctn = null; switch (type) { case "text/plain": - ctn = content; + ctn = ( + ( + + {decoratedText} + + )} + > + {content} + + ); break; case "image/jpeg": ctn = ( @@ -45,7 +55,7 @@ export default function Message({ const [myRef, inView] = useInViewRef(); const disptach = useDispatch(); const avatarRef = useRef(null); - const { data: contacts } = useGetContactsQuery(); + const contacts = useSelector((store) => store.contacts); useEffect(() => { if (!unread) { avatarRef.current?.scrollIntoView(); @@ -72,7 +82,7 @@ export default function Message({ content={} >
- +
diff --git a/src/common/component/Message/styled.js b/src/common/component/Message/styled.js index dc665312..0ff8062c 100644 --- a/src/common/component/Message/styled.js +++ b/src/common/component/Message/styled.js @@ -56,6 +56,12 @@ const StyledMsg = styled.div` .img { max-width: 400px; } + a { + border-radius: 2px; + background-color: #f5feff; + padding: 2px; + color: #1fe1f9; + } } } `; diff --git a/src/routes/chat/ChannelList.js b/src/routes/chat/ChannelList.js index 9b3fc9dd..a6a91177 100644 --- a/src/routes/chat/ChannelList.js +++ b/src/routes/chat/ChannelList.js @@ -34,7 +34,14 @@ const NavItem = ({ data, setFiles }) => { {name} - {unreads > 0 && {unreads}} +
+ + {unreads > 0 && ( + 99 ? "dot" : ""}`}> + {unreads > 99 ? null : unreads} + + )} +
); }; diff --git a/src/routes/chat/Layout.js b/src/routes/chat/Layout.js index a56b1f7c..a4246515 100644 --- a/src/routes/chat/Layout.js +++ b/src/routes/chat/Layout.js @@ -87,7 +87,7 @@ export default function Layout({ }), })); return ( - +
{header}
{children} diff --git a/src/routes/chat/styled.js b/src/routes/chat/styled.js index 448af505..201b1c1f 100644 --- a/src/routes/chat/styled.js +++ b/src/routes/chat/styled.js @@ -58,23 +58,39 @@ const StyledWrapper = styled.div` font-size: 14px; line-height: 20px; } - > .badge { - color: #fff; + > .icons { display: flex; align-items: center; - justify-content: center; - height: 20px; - min-width: 20px; - border-radius: 50%; - background: #bfbfbf; - font-weight: 900; - font-size: 10px; - line-height: 10px; - &.dot { - width: 6px; - height: 6px; - padding: 0; + gap: 4px; + > .setting { + visibility: hidden; + display: flex; + width: 16px; + height: 16px; + background-image: url("https://static.nicegoodthings.com/project/rustchat/icon.setting.svg"); } + > .badge { + color: #fff; + display: flex; + align-items: center; + justify-content: center; + height: 20px; + min-width: 20px; + border-radius: 50%; + background: #bfbfbf; + font-weight: 900; + font-size: 10px; + line-height: 10px; + &.dot { + min-width: unset; + width: 6px; + height: 6px; + padding: 0; + } + } + } + &:hover > .icons > .setting { + visibility: visible; } } .session { diff --git a/src/routes/home/Menu.js b/src/routes/home/Menu.js index 100c4026..5fa45edf 100644 --- a/src/routes/home/Menu.js +++ b/src/routes/home/Menu.js @@ -37,7 +37,11 @@ export default function Menu({ toggle, expand = true }) { alt="setting icon" className="icon" /> - {expand && Settings} + {expand && ( + + Settings + + )}
  • expand icon - {expand && Expand} + {expand && ( + Expand + )}
  • ); diff --git a/src/routes/home/ServerDropList.js b/src/routes/home/ServerDropList.js index 51fb4509..f1968cdb 100644 --- a/src/routes/home/ServerDropList.js +++ b/src/routes/home/ServerDropList.js @@ -1,6 +1,6 @@ // import React from 'react'; import styled from "styled-components"; -import { HiChevronDoubleLeft } from "react-icons/hi"; +// import { HiChevronDoubleLeft } from "react-icons/hi"; const StyledWrapper = styled.div` height: 56px; @@ -38,7 +38,11 @@ export default function ServerDropList({ data, expand = true }) {
    logo - {expand &&

    {data.name}

    } + {expand && ( +

    + {data.name} +

    + )}
    ); diff --git a/src/routes/home/Tools.js b/src/routes/home/Tools.js index f464fa30..457b65f8 100644 --- a/src/routes/home/Tools.js +++ b/src/routes/home/Tools.js @@ -73,19 +73,29 @@ export default function Tools({ expand = true }) { alt="logo" />
    - {expand &&

    Webrowse

    } + {expand && ( +

    + Webrowse +

    + )}
  • - {expand &&

    Github

    } + {expand && ( +

    Github

    + )}
  • - {expand &&

    Add new app

    } + {expand && ( +

    + Add new app +

    + )}