mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-27 04:16:25 -08:00
better compliance to landscape view limitations
This commit is contained in:
1 parent
1fd0981231
commit
e563d52740
5 files changed
+40
-5
No files matched your search
@@ -55,6 +55,7 @@ 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 = {
|
||||
requestClose: () => void;
|
||||
@@ -245,9 +246,15 @@ export function Direct() {
|
||||
closedCategories.has(categoryId)
|
||||
);
|
||||
|
||||
const screenSize = useScreenSizeContext();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box style={{ width: !mobileOrTablet() ? toRem(curWidth) : '100%' }}>
|
||||
<Box
|
||||
style={{
|
||||
width: mobileOrTablet() || screenSize === ScreenSize.Mobile ? '100%' : toRem(curWidth),
|
||||
}}
|
||||
>
|
||||
<PageNav>
|
||||
<DirectHeader />
|
||||
{noRoomToDisplay ? (
|
||||
|
||||
@@ -34,6 +34,7 @@ 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';
|
||||
|
||||
export function AddServer() {
|
||||
const mx = useMatrixClient();
|
||||
@@ -170,9 +171,15 @@ export function Explore() {
|
||||
useEffect(() => {
|
||||
setCurWidth(roomSidebarWidth);
|
||||
}, [roomSidebarWidth]);
|
||||
const screenSize = useScreenSizeContext();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box style={{ width: !mobileOrTablet() ? toRem(curWidth) : '100%' }}>
|
||||
<Box
|
||||
style={{
|
||||
width: mobileOrTablet() || screenSize === ScreenSize.Mobile ? '100%' : toRem(curWidth),
|
||||
}}
|
||||
>
|
||||
<PageNav>
|
||||
<PageNavHeader>
|
||||
<Box grow="Yes" gap="300">
|
||||
|
||||
@@ -64,6 +64,7 @@ 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 = {
|
||||
requestClose: () => void;
|
||||
@@ -248,9 +249,15 @@ export function Home() {
|
||||
closedCategories.has(categoryId)
|
||||
);
|
||||
|
||||
const screenSize = useScreenSizeContext();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box style={{ width: !mobileOrTablet() ? toRem(curWidth) : '100%' }}>
|
||||
<Box
|
||||
style={{
|
||||
width: mobileOrTablet() || screenSize === ScreenSize.Mobile ? '100%' : toRem(curWidth),
|
||||
}}
|
||||
>
|
||||
<PageNav>
|
||||
<HomeHeader />
|
||||
{noRoomToDisplay ? (
|
||||
|
||||
@@ -12,6 +12,7 @@ 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() {
|
||||
const invitesSelected = useInboxInvitesSelected();
|
||||
@@ -54,9 +55,15 @@ export function Inbox() {
|
||||
useEffect(() => {
|
||||
setCurWidth(roomSidebarWidth);
|
||||
}, [roomSidebarWidth]);
|
||||
const screenSize = useScreenSizeContext();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box style={{ width: !mobileOrTablet() ? toRem(curWidth) : '100%' }}>
|
||||
<Box
|
||||
style={{
|
||||
width: mobileOrTablet() || screenSize === ScreenSize.Mobile ? '100%' : toRem(curWidth),
|
||||
}}
|
||||
>
|
||||
<PageNav>
|
||||
<PageNavHeader>
|
||||
<Box grow="Yes" gap="300">
|
||||
|
||||
@@ -81,6 +81,7 @@ import { SwipeableOverlayWrapper } from '$components/SwipeableOverlayWrapper';
|
||||
import { useCallEmbed } from '$hooks/useCallEmbed';
|
||||
import { createDebugLogger } from '$utils/debugLogger';
|
||||
import { SidebarResizer } from '$pages/client/sidebar/SidebarResizer';
|
||||
import { ScreenSize, useScreenSizeContext } from '$hooks/useScreenSize';
|
||||
|
||||
const debugLog = createDebugLogger('Space');
|
||||
|
||||
@@ -724,9 +725,15 @@ export function Space() {
|
||||
}
|
||||
}, [lastRoomId, spaceIdOrAlias, mx, navigate]);
|
||||
|
||||
const screenSize = useScreenSizeContext();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box style={{ width: !mobileOrTablet() ? toRem(curWidth) : '100%' }}>
|
||||
<Box
|
||||
style={{
|
||||
width: mobileOrTablet() || screenSize === ScreenSize.Mobile ? '100%' : toRem(curWidth),
|
||||
}}
|
||||
>
|
||||
<PageNav>
|
||||
<SwipeableOverlayWrapper direction="left" onClose={handleSwipeToRoom}>
|
||||
<SpaceHeader />
|
||||
|
||||
Reference in new issue
Block a user