diff --git a/raven-app/src/components/common/UserAvatar.tsx b/raven-app/src/components/common/UserAvatar.tsx index a6bb95380..91d296a98 100644 --- a/raven-app/src/components/common/UserAvatar.tsx +++ b/raven-app/src/components/common/UserAvatar.tsx @@ -1,5 +1,3 @@ -import { useInView } from 'react-intersection-observer' -import { Skeleton } from './Skeleton' import { Avatar, Theme } from '@radix-ui/themes' import { AvatarProps } from '@radix-ui/themes/dist/cjs/components/avatar' import { BoxProps } from '@radix-ui/themes/dist/cjs/components/box' @@ -14,12 +12,6 @@ interface UserAvatarProps extends Partial { isBot?: boolean, skeletonSize?: BoxProps['width'] | BoxProps['height'], } -const options = { - root: null, - rootMargin: "50px", - threshold: 0.5, - triggerOnce: true -} export const getInitials = (name?: string) => { if (!name) return '' @@ -27,21 +19,6 @@ export const getInitials = (name?: string) => { return firstName[0] + (lastName?.[0] ?? '') } -const radixRadiusToTailwind = (radius: "none" | "small" | "medium" | "large" | "full") => { - switch (radius) { - case "none": - return "rounded-none" - case "small": - return "rounded-sm" - case "medium": - return "rounded-md" - case "large": - return "rounded-lg" - case "full": - return "rounded-full" - } -} - const getIconSize = (size: AvatarProps['size']) => { switch (size) { case '1': @@ -69,14 +46,11 @@ const getIconSize = (size: AvatarProps['size']) => { } export const UserAvatar = ({ src, alt, size = '1', radius = 'medium', isActive, skeletonSize = '5', fallback, isBot, className, ...props }: UserAvatarProps) => { - const { ref, inView } = useInView(options) const color = useMemo(() => generateAvatarColor(alt), [alt]) - return - {inView ? - - : - - } + return + {isActive && diff --git a/raven-app/src/components/feature/channels/ChannelList.tsx b/raven-app/src/components/feature/channels/ChannelList.tsx index f1b4eed50..530c2e61e 100644 --- a/raven-app/src/components/feature/channels/ChannelList.tsx +++ b/raven-app/src/components/feature/channels/ChannelList.tsx @@ -53,7 +53,7 @@ export const ChannelList = ({ unread_count }: { unread_count?: UnreadCountData } }, [channels, myProfile, unread_count]) const ref = useRef(null) - const [height, setHeight] = useState(ref?.current?.clientHeight ?? 0) + const [height, setHeight] = useState(ref?.current?.clientHeight ?? showData ? filteredChannels.length * (36) - 4 : 0) useLayoutEffect(() => { setHeight(ref.current?.clientHeight ?? 0) @@ -81,7 +81,7 @@ export const ChannelList = ({ unread_count }: { unread_count?: UnreadCountData }
diff --git a/raven-app/src/components/feature/channels/CreateChannelModal.tsx b/raven-app/src/components/feature/channels/CreateChannelModal.tsx index efc0a5af5..b77e976cf 100644 --- a/raven-app/src/components/feature/channels/CreateChannelModal.tsx +++ b/raven-app/src/components/feature/channels/CreateChannelModal.tsx @@ -94,7 +94,7 @@ export const CreateChannelButton = ({ updateChannelList }: { updateChannelList: return + className='group-hover:visible invisible transition-all ease-ease text-gray-10 dark:text-gray-300 bg-transparent hover:bg-gray-3'> {/* */} diff --git a/raven-app/src/components/feature/chat/ChatInput/Tiptap.tsx b/raven-app/src/components/feature/chat/ChatInput/Tiptap.tsx index bd93b60b9..2cc8edb60 100644 --- a/raven-app/src/components/feature/chat/ChatInput/Tiptap.tsx +++ b/raven-app/src/components/feature/chat/ChatInput/Tiptap.tsx @@ -457,7 +457,7 @@ const Tiptap = ({ slotBefore, fileProps, onMessageSend, replyMessage, clearReply return ( - + {slotBefore} diff --git a/raven-app/src/components/feature/chat/ChatStream/ChatBoxBody.tsx b/raven-app/src/components/feature/chat/ChatStream/ChatBoxBody.tsx index c4ef18154..17150e7c3 100644 --- a/raven-app/src/components/feature/chat/ChatStream/ChatBoxBody.tsx +++ b/raven-app/src/components/feature/chat/ChatStream/ChatBoxBody.tsx @@ -1,5 +1,5 @@ import { Message } from "../../../../../../types/Messaging/Message" -import { Suspense, lazy, useContext, useMemo, useState } from "react" +import { useContext, useMemo, useState } from "react" import { ArchivedChannelBox } from "../chat-footer/ArchivedChannelBox" import { ChannelListItem, DMChannelListItem } from "@/utils/channel/ChannelListProvider" import { JoinChannelBox } from "../chat-footer/JoinChannelBox" @@ -9,13 +9,11 @@ import useFileUpload from "../ChatInput/FileInput/useFileUpload" import { CustomFile, FileDrop } from "../../file-upload/FileDrop" import { FileListItem } from "../../file-upload/FileListItem" import { useSendMessage } from "../ChatInput/useSendMessage" -import { Loader } from "@/components/common/Loader" import { Flex, Box, IconButton } from "@radix-ui/themes" import { ReplyMessageBox } from "../ChatMessage/ReplyMessageBox/ReplyMessageBox" import { BiX } from "react-icons/bi" import ChatStream from "./ChatStream" - -const Tiptap = lazy(() => import("../ChatInput/Tiptap")) +import Tiptap from "../ChatInput/Tiptap" const COOL_PLACEHOLDERS = [ "Delivering messages atop dragons 🐉 is available on a chargeable basis.", @@ -27,7 +25,7 @@ const COOL_PLACEHOLDERS = [ "Want to know who writes these placeholders? 🤔. No one.", "Type a message..." ] -const randomPlaceholder = COOL_PLACEHOLDERS[Math.floor(Math.random() * (COOL_PLACEHOLDERS.length))] +// const randomPlaceholder = COOL_PLACEHOLDERS[Math.floor(Math.random() * (COOL_PLACEHOLDERS.length))] interface ChatBoxBodyProps { channelData: ChannelListItem | DMChannelListItem } @@ -95,27 +93,25 @@ export const ChatBoxBody = ({ channelData }: ChatBoxBodyProps) => { /> {channelData?.is_archived == 0 && (isUserInChannel || channelData?.type === 'Open') && - }> - + } + /> } {channelData && !isLoading && <> {channelData.is_archived == 0 && !isUserInChannel && channelData.type !== 'Open' && !isDM && diff --git a/raven-app/src/components/feature/chat/ChatStream/ChatStream.tsx b/raven-app/src/components/feature/chat/ChatStream/ChatStream.tsx index e446ff872..1683b08d4 100644 --- a/raven-app/src/components/feature/chat/ChatStream/ChatStream.tsx +++ b/raven-app/src/components/feature/chat/ChatStream/ChatStream.tsx @@ -119,7 +119,7 @@ const ChatStream = ({ replyToMessage }: Props) => { {!isLoading && !hasOlderMessages && } {isLoading && } {error && } -
+
{messages?.map(message => { if (message.message_type === 'date') { return diff --git a/raven-app/src/components/feature/direct-messages/DirectMessageList.tsx b/raven-app/src/components/feature/direct-messages/DirectMessageList.tsx index d4b142778..20fb0c756 100644 --- a/raven-app/src/components/feature/direct-messages/DirectMessageList.tsx +++ b/raven-app/src/components/feature/direct-messages/DirectMessageList.tsx @@ -24,7 +24,7 @@ export const DirectMessageList = ({ unread_count }: { unread_count?: UnreadCount const ref = useRef(null) - const [height, setHeight] = useState(ref?.current?.clientHeight ?? 0) + const [height, setHeight] = useState(ref?.current?.clientHeight ?? showData ? (dm_channels.length + extra_users.length) * (34.79) : 0) useLayoutEffect(() => { setHeight(ref.current?.clientHeight ?? 0) @@ -48,7 +48,7 @@ export const DirectMessageList = ({ unread_count }: { unread_count?: UnreadCount style={{ height: showData ? height : 0 }}> -
+
{extra_users && extra_users.length ? : null}
diff --git a/raven-app/src/components/layout/Sidebar/SidebarComp.tsx b/raven-app/src/components/layout/Sidebar/SidebarComp.tsx index 8718c4620..70e92c041 100644 --- a/raven-app/src/components/layout/Sidebar/SidebarComp.tsx +++ b/raven-app/src/components/layout/Sidebar/SidebarComp.tsx @@ -51,7 +51,7 @@ interface SidebarGroupListProps extends FlexProps { export const SidebarGroupList = ({ children, ...props }: SidebarGroupListProps) => { return ( - + {children} ) @@ -147,7 +147,7 @@ export const SidebarViewMoreButton = ({ expanded, onClick, ...props }: SidebarVi radius='large' onClick={onClick} {...props} - className={clsx('cursor-pointer transition-all text-gray-10 dark:text-gray-300 bg-transparent hover:bg-gray-3 invisible group-hover:visible ease-in-out')} + className={clsx('cursor-pointer transition-all text-gray-10 dark:text-gray-300 bg-transparent hover:bg-gray-3 invisible group-hover:visible ease-ease')} > {expanded ? : } diff --git a/raven-app/tailwind.config.js b/raven-app/tailwind.config.js index e98f8d713..aa265c4c5 100644 --- a/raven-app/tailwind.config.js +++ b/raven-app/tailwind.config.js @@ -142,7 +142,7 @@ export default { radius6: 'var(--radius-6)', }, animation: { - fadein: 'fadeIn .3s ease-in', + fadein: 'fadeIn .25s ease-out', }, keyframes: { @@ -151,6 +151,32 @@ export default { to: { opacity: 1 }, }, }, + transitionTimingFunction: { + // Quad is the strongest easing curve + // Circ is the weakest easing curve + 'ease-in-quad': 'cubic-bezier(.55, .085, .68, .53)', + 'ease-in-cubic': 'cubic-bezier(.55, .055, .675, .19)', + 'ease-in-quart': 'cubic-bezier(.895, .03, .685, .22)', + 'ease-in-quint': 'cubic-bezier(.755, .05, .855, .06)', + 'ease-in-expo': 'cubic-bezier(.95, .05, .795, .035)', + 'ease-in-circ': 'cubic-bezier(.6, .04, .98, .335)', + + 'ease-out-quad': 'cubic-bezier(.25, .46, .45, .94)', + 'ease-out-cubic': 'cubic-bezier(.215, .61, .355, 1)', + 'ease-out-quart': 'cubic-bezier(.165, .84, .44, 1)', + 'ease-out-quint': 'cubic-bezier(.23, 1, .32, 1)', + 'ease-out-expo': 'cubic-bezier(.19, 1, .22, 1)', + 'ease-out-circ': 'cubic-bezier(.075, .82, .165, 1)', + + 'ease-in-out-quad': 'cubic-bezier(.455, .03, .515, .955)', + 'ease-in-out-cubic': 'cubic-bezier(.645, .045, .355, 1)', + 'ease-in-out-quart': 'cubic-bezier(.77, 0, .175, 1)', + 'ease-in-out-quint': 'cubic-bezier(.86, 0, .07, 1)', + 'ease-in-out-expo': 'cubic-bezier(1, 0, 0, 1)', + 'ease-in-out-circ': 'cubic-bezier(.785, .135, .15, .86)', + + 'ease': 'cubic-bezier(0.25, 0.1, 0.25, 1)' + } }, }, darkMode: 'class',