diff --git a/src/components/channel/Channel.tsx b/src/components/channel/Channel.tsx index 386b694..d167d49 100644 --- a/src/components/channel/Channel.tsx +++ b/src/components/channel/Channel.tsx @@ -133,10 +133,14 @@ export default function Channel({ channel }: Readonly) { } useEffect(() => { - mainRef.current?.scrollIntoView({ - behavior: 'smooth' - }); - }, []); + setTimeout( + () => + mainRef.current?.scrollIntoView({ + behavior: 'smooth' + }), + 50 + ); + }, [channel.id]); return ( @@ -162,9 +166,9 @@ export default function Channel({ channel }: Readonly) { return ( <> - {isHeadless ? null : } + {!isHeadless && } {MessageElement} - {i === stateMessages.length - 1 ? : null} + {i === stateMessages.length - 1 && } ); })} diff --git a/src/components/channel/ChannelTopBarContent.tsx b/src/components/channel/ChannelTopBarContent.tsx index 9f98540..8f8fa6e 100644 --- a/src/components/channel/ChannelTopBarContent.tsx +++ b/src/components/channel/ChannelTopBarContent.tsx @@ -6,7 +6,7 @@ import useThemeColors from '@/hooks/useThemeColors'; import { toggleChannelMembers } from '@/store/slices/collapsiblesSlice'; import { ChannelTypes } from '@/types/enums/ChannelTypes'; import type { Channel } from '@/types/interfaces/Channel'; -import { Flex, Icon, IconButton, Spacer, useDisclosure } from '@chakra-ui/react'; +import { Flex, Icon, IconButton, Spacer, useDisclosure } from '@chakra-ui/react'; import { useState } from 'react'; import { MdAlternateEmail, MdMenu, MdNumbers, MdPeople, MdPhone, MdSearch, MdVideocam } from 'react-icons/md'; import { useDispatch } from 'react-redux'; @@ -60,23 +60,32 @@ export default function ChannelTopBarContent({ }} /> )} - + + + + {channel.type === ChannelTypes.DirectMessage ? recipient.username : channel.name} + + {channel.type === ChannelTypes.DirectMessage && ( )} - - {channel.type === ChannelTypes.DirectMessage ? recipient.username : channel.name} - {channel.type === ChannelTypes.DirectMessage && ( <> diff --git a/src/components/channel/Message.tsx b/src/components/channel/Message.tsx index 896a494..0953f3f 100644 --- a/src/components/channel/Message.tsx +++ b/src/components/channel/Message.tsx @@ -66,10 +66,10 @@ export default function Message({ message, headless, onShowAuthor, ...props }: M )} - {headless ? null : ( + {!headless && ( ) { const { getColorValue } = useThemeColors(); const { isMobile } = useDevice(); const [mobileShowSidebar, setMobileShowSidebar] = useState(true); return ( <> - + {isMobile && ( -
- } - onClick={() => { - if (mobileShowSidebar) { - friendsFlexRef.current?.scrollIntoView({ - behavior: 'smooth' - }); - setMobileShowSidebar(false); - } else { - friendsRef.current?.scrollIntoView({ - behavior: 'smooth' - }); - setMobileShowSidebar(true); - } - }} - /> -
- )} -
- -
-
- Friends -
-
- - 20 - -
-
- - -
} + icon={} + onClick={() => { + if (mobileShowSidebar) { + friendsFlexRef.current?.scrollIntoView({ + behavior: 'smooth' + }); + setMobileShowSidebar(false); + } else { + friendsRef.current?.scrollIntoView({ + behavior: 'smooth' + }); + setMobileShowSidebar(true); + } + }} /> -
-
- } /> -
+ )} + + + + + Friends + + + + + 20 + +
+ + + } /> + } /> ); diff --git a/src/components/general/AppWrapper.tsx b/src/components/general/AppWrapper.tsx index f30e584..8b9d45f 100644 --- a/src/components/general/AppWrapper.tsx +++ b/src/components/general/AppWrapper.tsx @@ -39,6 +39,7 @@ export default function AppWrapper({ children }: any) { scrollSnapType='x mandatory' scrollSnapStop='always' scrollBehavior='smooth' + style={{ scrollbarWidth: 'none' }} overflow='auto' > {children} diff --git a/src/components/layout/GuildSidebar.tsx b/src/components/layout/GuildSidebar.tsx index cc87fd3..4391aa1 100644 --- a/src/components/layout/GuildSidebar.tsx +++ b/src/components/layout/GuildSidebar.tsx @@ -9,7 +9,7 @@ import { Box, Center, Flex, Icon, Stack } from '@chakra-ui/react'; import Link from 'next/link'; import { useState } from 'react'; import { MdNumbers } from 'react-icons/md'; -import { useDispatch, useSelector } from 'react-redux'; +import { useSelector } from 'react-redux'; import OverflownText from '../misc/OverflownText'; import ProfileBox from './ProfileBox'; @@ -98,7 +98,7 @@ export default function GuildSidebar({ guild }: { guild: IGuild }) { bg={getColorValue('ternaryBackground')} alignItems='center' > - {guild.name} + {guild.name}
diff --git a/src/components/modals/UserProfileModal.tsx b/src/components/modals/UserProfileModal.tsx index 5cbbc45..9a809a5 100644 --- a/src/components/modals/UserProfileModal.tsx +++ b/src/components/modals/UserProfileModal.tsx @@ -49,7 +49,7 @@ export default function UserProfileModal({
- + @{user.username} {user.presence && ( diff --git a/src/components/screens/GuildChannelScreen.tsx b/src/components/screens/GuildChannelScreen.tsx index 30c9eca..f428925 100644 --- a/src/components/screens/GuildChannelScreen.tsx +++ b/src/components/screens/GuildChannelScreen.tsx @@ -53,13 +53,9 @@ export default function GuildChannelScreen() { return ; } - console.log(selectedState); - const channel = channels.find((channel) => channel.id === selectedState.guilds[guild.id]); if (!channel) { - console.log('Sending to friends (no channel) GuildchannelScreen'); - router.prefetch(`/guilds/${guild.id}`); router.push(`/guilds/${guild.id}`); diff --git a/src/components/screens/GuildScreen.tsx b/src/components/screens/GuildScreen.tsx index 3de4e9f..d00a7b9 100644 --- a/src/components/screens/GuildScreen.tsx +++ b/src/components/screens/GuildScreen.tsx @@ -26,8 +26,6 @@ export default function GuildScreen() { const guild = guildsState.guilds.find((guildState) => guildState.id === selectedState.selectedGuild); if (!guild) { - console.log('Sending to friends (no guild) GuildScreen'); - router.prefetch('/friends'); router.push('/friends'); diff --git a/src/components/user/StatusIndicator.tsx b/src/components/user/StatusIndicator.tsx index 4d5f789..11a9700 100644 --- a/src/components/user/StatusIndicator.tsx +++ b/src/components/user/StatusIndicator.tsx @@ -43,6 +43,8 @@ export default function StatusIndicator({ status, size, positioned = true, toolt