Skip to content

Commit

Permalink
feat: improve layout on desktop/tablets
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexogamer committed Jan 15, 2024
1 parent aa10098 commit 8f9e525
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 19 deletions.
52 changes: 35 additions & 17 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,23 +348,41 @@ class MainView extends React.Component {
<View style={styles.app}>
{this.state.status === 'loggedIn' ? (
<>
<SideMenuBase
openMenuOffset={Dimensions.get('window').width - 50}
overlayColor={'#00000040'}
edgeHitWidth={Dimensions.get('window').width}
isOpen={this.state.leftMenuOpen}
onChange={open => this.setState({leftMenuOpen: open})}
menu={
<SideMenu
onChannelClick={this.setChannel.bind(this)}
currentChannel={this.state.currentChannel}
orderedServers={this.state.orderedServers}
/>
}
style={styles.app}
bounceBackOnOverdraw={false}>
<ChannelView state={this} channel={this.state.currentChannel} />
</SideMenuBase>
{Dimensions.get('window').width >
Dimensions.get('window').height ? (
<View style={{flex: 1, flexDirection: 'row'}}>
<View
style={{
width: '20%',
flexDirection: 'column',
}}>
<SideMenu
onChannelClick={this.setChannel.bind(this)}
currentChannel={this.state.currentChannel}
orderedServers={this.state.orderedServers}
/>
</View>
<ChannelView state={this} channel={this.state.currentChannel} />
</View>
) : (
<SideMenuBase
openMenuOffset={Dimensions.get('window').width - 50}
overlayColor={'#00000040'}
edgeHitWidth={Dimensions.get('window').width}
isOpen={this.state.leftMenuOpen}
onChange={open => this.setState({leftMenuOpen: open})}
menu={
<SideMenu
onChannelClick={this.setChannel.bind(this)}
currentChannel={this.state.currentChannel}
orderedServers={this.state.orderedServers}
/>
}
style={styles.app}
bounceBackOnOverdraw={false}>
<ChannelView state={this} channel={this.state.currentChannel} />
</SideMenuBase>
)}
<Modals />
<NetworkIndicator client={client} />
<View
Expand Down
1 change: 1 addition & 0 deletions src/components/common/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const BottomSheet = observer(
snapPoints={snapPoints}
enablePanDownToClose
backdropComponent={BottomSheetBackdrop}
style={{margin: 'auto', maxWidth: 800}}
backgroundStyle={{
backgroundColor: currentTheme.backgroundSecondary,
}}
Expand Down
4 changes: 2 additions & 2 deletions src/components/sheets/ProfileSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ export const ProfileSheet = observer(() => {
</>
) : (
<>
<View style={{flexDirection: 'row', width: '80%'}}>
<View
style={{flexDirection: 'row', justifyContent: 'space-between'}}>
<Avatar
size={80}
user={user}
Expand All @@ -158,7 +159,6 @@ export const ProfileSheet = observer(() => {
/>
<View
style={{
marginLeft: '90%',
justifyContent: 'center',
alignItems: 'center',
}}>
Expand Down

0 comments on commit 8f9e525

Please sign in to comment.