mirror of
https://github.com/SableClient/Sable.git
synced 2026-12-02 23:02:33 -08:00
fix: tablet layouts taking full screen
This commit is contained in:
1 parent
a64c28a7aa
commit
9f0d0651bf
7 files changed
+18
-18
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
default: patch
|
||||
---
|
||||
|
||||
Fix tablet layouts having the sidebar fill up the screen.
|
||||
@@ -57,7 +57,6 @@ import { useSableCosmetics } from '$hooks/useSableCosmetics';
|
||||
import { formatCompactNumber } from '$utils/formatCompactNumber';
|
||||
import * as css from './MembersDrawer.css';
|
||||
import { SidebarResizer } from '$pages/client/sidebar/SidebarResizer';
|
||||
import { mobileOrTablet } from '$utils/user-agent';
|
||||
import { useScreenSizeContext, ScreenSize } from '$hooks/useScreenSize';
|
||||
|
||||
type MemberDrawerHeaderProps = {
|
||||
@@ -317,7 +316,7 @@ export function MembersDrawer({ room, members }: MembersDrawerProps) {
|
||||
}, [memberSidebarWidth]);
|
||||
|
||||
const screenSize = useScreenSizeContext();
|
||||
const isMobile = mobileOrTablet() || screenSize === ScreenSize.Mobile;
|
||||
const isMobile = screenSize === ScreenSize.Mobile;
|
||||
const hideText = curWidth <= 80 && !isMobile;
|
||||
return (
|
||||
<Box
|
||||
@@ -326,12 +325,12 @@ export function MembersDrawer({ room, members }: MembersDrawerProps) {
|
||||
direction="Column"
|
||||
style={{
|
||||
position: 'relative',
|
||||
width: !mobileOrTablet() ? toRem(curWidth) : '100%',
|
||||
width: isMobile ? '100%' : toRem(curWidth),
|
||||
}}
|
||||
>
|
||||
<MemberDrawerHeader room={room} hideText={hideText} />
|
||||
<Box className={css.MemberDrawerContentBase} grow="Yes">
|
||||
{!mobileOrTablet() && (
|
||||
{!isMobile && (
|
||||
<SidebarResizer
|
||||
setCurWidth={setCurWidth}
|
||||
sidebarWidth={memberSidebarWidth}
|
||||
|
||||
@@ -54,7 +54,6 @@ import {
|
||||
import { useDirectCreateSelected } from '$hooks/router/useDirectSelected';
|
||||
import { useDirectRooms } from './useDirectRooms';
|
||||
import { SidebarResizer } from '$pages/client/sidebar/SidebarResizer';
|
||||
import { mobileOrTablet } from '$utils/user-agent';
|
||||
import { useScreenSizeContext, ScreenSize } from '$hooks/useScreenSize';
|
||||
|
||||
type DirectMenuProps = {
|
||||
@@ -256,7 +255,7 @@ export function Direct() {
|
||||
);
|
||||
|
||||
const screenSize = useScreenSizeContext();
|
||||
const isMobile = mobileOrTablet() || screenSize === ScreenSize.Mobile;
|
||||
const isMobile = screenSize === ScreenSize.Mobile;
|
||||
const hideText = curWidth <= 80 && !isMobile;
|
||||
|
||||
return (
|
||||
@@ -367,7 +366,7 @@ export function Direct() {
|
||||
</PageNavContent>
|
||||
)}
|
||||
</PageNav>
|
||||
{!mobileOrTablet() && (
|
||||
{!isMobile && (
|
||||
<SidebarResizer
|
||||
setCurWidth={setCurWidth}
|
||||
sidebarWidth={roomSidebarWidth}
|
||||
|
||||
@@ -32,7 +32,6 @@ import { stopPropagation } from '$utils/keyboard';
|
||||
import { SidebarResizer } from '$pages/client/sidebar/SidebarResizer';
|
||||
import { settingsAtom } from '$state/settings';
|
||||
import { useSetting } from '$state/hooks/settings';
|
||||
import { mobileOrTablet } from '$utils/user-agent';
|
||||
import { getMxIdServer } from '$utils/mxIdHelper';
|
||||
import { useScreenSizeContext, ScreenSize } from '$hooks/useScreenSize';
|
||||
|
||||
@@ -178,7 +177,7 @@ export function Explore() {
|
||||
setCurWidth(roomSidebarWidth);
|
||||
}, [roomSidebarWidth]);
|
||||
const screenSize = useScreenSizeContext();
|
||||
const isMobile = mobileOrTablet() || screenSize === ScreenSize.Mobile;
|
||||
const isMobile = screenSize === ScreenSize.Mobile;
|
||||
const hideText = curWidth <= 80 && !isMobile;
|
||||
|
||||
return (
|
||||
@@ -312,7 +311,7 @@ export function Explore() {
|
||||
</Box>
|
||||
</PageNavContent>
|
||||
</PageNav>
|
||||
{!mobileOrTablet() && (
|
||||
{!isMobile && (
|
||||
<SidebarResizer
|
||||
setCurWidth={setCurWidth}
|
||||
sidebarWidth={roomSidebarWidth}
|
||||
|
||||
@@ -63,7 +63,6 @@ import { UseStateProvider } from '$components/UseStateProvider';
|
||||
import { JoinAddressPrompt } from '$components/join-address-prompt';
|
||||
import { useHomeRooms } from './useHomeRooms';
|
||||
import { SidebarResizer } from '$pages/client/sidebar/SidebarResizer';
|
||||
import { mobileOrTablet } from '$utils/user-agent';
|
||||
import { ScreenSize, useScreenSizeContext } from '$hooks/useScreenSize';
|
||||
|
||||
type HomeMenuProps = {
|
||||
@@ -263,7 +262,7 @@ export function Home() {
|
||||
);
|
||||
|
||||
const screenSize = useScreenSizeContext();
|
||||
const isMobile = mobileOrTablet() || screenSize === ScreenSize.Mobile;
|
||||
const isMobile = screenSize === ScreenSize.Mobile;
|
||||
const hideText = curWidth <= 80 && !isMobile;
|
||||
|
||||
return (
|
||||
@@ -454,7 +453,7 @@ export function Home() {
|
||||
</PageNavContent>
|
||||
)}
|
||||
</PageNav>
|
||||
{!mobileOrTablet() && (
|
||||
{!isMobile && (
|
||||
<SidebarResizer
|
||||
setCurWidth={setCurWidth}
|
||||
sidebarWidth={roomSidebarWidth}
|
||||
|
||||
@@ -11,7 +11,6 @@ import { SidebarResizer } from '$pages/client/sidebar/SidebarResizer';
|
||||
import { useSetting } from '$state/hooks/settings';
|
||||
import { settingsAtom } from '$state/settings';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { mobileOrTablet } from '$utils/user-agent';
|
||||
import { ScreenSize, useScreenSizeContext } from '$hooks/useScreenSize';
|
||||
|
||||
function InvitesNavItem({ hideText }: { hideText?: boolean }) {
|
||||
@@ -62,7 +61,7 @@ export function Inbox() {
|
||||
setCurWidth(roomSidebarWidth);
|
||||
}, [roomSidebarWidth]);
|
||||
const screenSize = useScreenSizeContext();
|
||||
const isMobile = mobileOrTablet() || screenSize === ScreenSize.Mobile;
|
||||
const isMobile = screenSize === ScreenSize.Mobile;
|
||||
const hideText = curWidth <= 80 && !isMobile;
|
||||
|
||||
return (
|
||||
@@ -118,7 +117,7 @@ export function Inbox() {
|
||||
</Box>
|
||||
</PageNavContent>
|
||||
</PageNav>
|
||||
{!mobileOrTablet() && (
|
||||
{!isMobile && (
|
||||
<SidebarResizer
|
||||
setCurWidth={setCurWidth}
|
||||
sidebarWidth={roomSidebarWidth}
|
||||
|
||||
@@ -857,7 +857,7 @@ export function Space() {
|
||||
}, [lastRoomId, spaceIdOrAlias, mx, navigate]);
|
||||
|
||||
const screenSize = useScreenSizeContext();
|
||||
const isMobile = mobileOrTablet() || screenSize === ScreenSize.Mobile;
|
||||
const isMobile = screenSize === ScreenSize.Mobile;
|
||||
const hideText = curWidth <= 80 && !isMobile;
|
||||
return (
|
||||
<Box
|
||||
@@ -1048,7 +1048,7 @@ export function Space() {
|
||||
</PageNavContent>
|
||||
</SwipeableOverlayWrapper>
|
||||
</PageNav>
|
||||
{!mobileOrTablet() && (
|
||||
{!isMobile && (
|
||||
<SidebarResizer
|
||||
setCurWidth={setCurWidth}
|
||||
sidebarWidth={roomSidebarWidth}
|
||||
|
||||
Reference in new issue
Block a user