sort out breakpoints for hopefully the final time
This commit is contained in:
@@ -61,15 +61,25 @@ function MessagesSplitViewLayout({children, navigation, route}: LayoutProps) {
|
|||||||
? route?.params?.conversation
|
? route?.params?.conversation
|
||||||
: undefined
|
: undefined
|
||||||
|
|
||||||
const leftNavWidth = centerColumnOffset
|
|
||||||
? LEFT_NAV_MINIMAL_WIDTH
|
|
||||||
: LEFT_NAV_FULL_WIDTH
|
|
||||||
const rightNavWidth = centerColumnOffset
|
const rightNavWidth = centerColumnOffset
|
||||||
? RIGHT_NAV_MINIMAL_WIDTH
|
? RIGHT_NAV_MINIMAL_WIDTH
|
||||||
: RIGHT_NAV_FULL_WIDTH
|
: RIGHT_NAV_FULL_WIDTH
|
||||||
|
|
||||||
const containerWidth =
|
const leftNavWidth = centerColumnOffset
|
||||||
leftNavWidth - LEFT_NAV_MINIMAL_WIDTH + CENTER_COLUMN_WIDTH + rightNavWidth
|
? LEFT_NAV_MINIMAL_WIDTH
|
||||||
|
: LEFT_NAV_FULL_WIDTH - LEFT_NAV_MINIMAL_WIDTH
|
||||||
|
|
||||||
|
// slight reduce width for smaller breakpoint
|
||||||
|
const centerColumnWidth = centerColumnOffset
|
||||||
|
? CENTER_COLUMN_WIDTH - 50
|
||||||
|
: CENTER_COLUMN_WIDTH
|
||||||
|
|
||||||
|
// nasty magic numbers here, sorry :(
|
||||||
|
const offset = centerColumnOffset
|
||||||
|
? LEFT_NAV_MINIMAL_WIDTH - 34
|
||||||
|
: LEFT_NAV_MINIMAL_WIDTH + 5
|
||||||
|
|
||||||
|
const containerWidth = leftNavWidth + centerColumnWidth + rightNavWidth
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
@@ -80,7 +90,7 @@ function MessagesSplitViewLayout({children, navigation, route}: LayoutProps) {
|
|||||||
{maxWidth: containerWidth},
|
{maxWidth: containerWidth},
|
||||||
{
|
{
|
||||||
transform: [
|
transform: [
|
||||||
{translateX: LEFT_NAV_MINIMAL_WIDTH},
|
{translateX: offset},
|
||||||
{translateX: web(SCROLLBAR_OFFSET) ?? 0},
|
{translateX: web(SCROLLBAR_OFFSET) ?? 0},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -91,7 +101,7 @@ function MessagesSplitViewLayout({children, navigation, route}: LayoutProps) {
|
|||||||
style={[
|
style={[
|
||||||
a.border_l,
|
a.border_l,
|
||||||
t.atoms.border_contrast_low,
|
t.atoms.border_contrast_low,
|
||||||
{width: containerWidth - CENTER_COLUMN_WIDTH},
|
{width: containerWidth - centerColumnWidth},
|
||||||
]}>
|
]}>
|
||||||
<ChatListHeader newChatControl={newChatControl} />
|
<ChatListHeader newChatControl={newChatControl} />
|
||||||
<ChatList
|
<ChatList
|
||||||
@@ -106,7 +116,7 @@ function MessagesSplitViewLayout({children, navigation, route}: LayoutProps) {
|
|||||||
style={[
|
style={[
|
||||||
a.border_x,
|
a.border_x,
|
||||||
t.atoms.border_contrast_low,
|
t.atoms.border_contrast_low,
|
||||||
{width: CENTER_COLUMN_WIDTH},
|
{width: centerColumnWidth},
|
||||||
]}>
|
]}>
|
||||||
{children}
|
{children}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
Reference in New Issue
Block a user