@@ -63,69 +63,70 @@ fun DrawerMenu(
6363) {
6464 val scope = rememberCoroutineScope()
6565
66- Scrim (
67- visible = drawerState.currentValue == DrawerValue .Open ,
68- onClick = {
69- scope.launch {
70- drawerState.close()
71- }
72- },
73- modifier = Modifier
74- .fillMaxSize()
75- .zIndex(zIndexScrim)
76- )
66+ Box (modifier = modifier.fillMaxSize()) {
67+ Scrim (
68+ visible = drawerState.currentValue == DrawerValue .Open ,
69+ onClick = {
70+ scope.launch {
71+ drawerState.close()
72+ }
73+ },
74+ modifier = Modifier
75+ .fillMaxSize()
76+ .zIndex(zIndexScrim)
77+ )
7778
78- AnimatedVisibility (
79- visible = drawerState.currentValue == DrawerValue .Open ,
80- enter = slideInHorizontally(
81- initialOffsetX = { it }
82- ),
83- exit = slideOutHorizontally(
84- targetOffsetX = { it }
85- ),
86- modifier = modifier.then(
87- Modifier
79+ AnimatedVisibility (
80+ visible = drawerState.currentValue == DrawerValue .Open ,
81+ enter = slideInHorizontally(
82+ initialOffsetX = { it }
83+ ),
84+ exit = slideOutHorizontally(
85+ targetOffsetX = { it }
86+ ),
87+ modifier = Modifier
88+ .align( Alignment . TopEnd )
8889 .fillMaxHeight()
8990 .zIndex(zIndexMenu)
9091 .blockPointerInputPassthrough()
91- )
92- ) {
93- MenuContent (
94- onWalletClick = {
95- if ( ! navigator.isAtHome()) navigator.navigateToHome()
96- scope.launch { drawerState.close() }
97- },
98- onActivityClick = {
99- navigator.navigate( Routes . Activity . All )
100- scope.launch { drawerState.close() }
101- },
102- onContactsClick = null , // TODO IMPLEMENT CONTACTS
103- onProfileClick = null , // TODO IMPLEMENT PROFILE
104- onWidgetsClick = {
105- if ( ! hasSeenWidgetsIntro) {
106- navigator.navigate( Routes . Widgets . Intro )
107- } else {
108- navigator.navigate( Routes . Widgets . Add )
109- }
110- scope.launch { drawerState.close() }
111- },
112- onShopClick = {
113- if ( ! hasSeenShopIntro) {
114- navigator.navigate( Routes . Shop . Intro )
115- } else {
116- navigator.navigate( Routes . Shop . Discover )
117- }
118- scope.launch { drawerState.close() }
119- },
120- onSettingsClick = {
121- navigator.navigate( Routes . Settings . Main )
122- scope.launch { drawerState.close() }
123- },
124- onAppStatusClick = {
125- navigator.navigate( Routes . AppStatus )
126- scope.launch { drawerState.close() }
127- },
128- )
92+ ) {
93+ MenuContent (
94+ onWalletClick = {
95+ if ( ! navigator.isAtHome()) navigator.navigateToHome()
96+ scope.launch { drawerState.close() }
97+ },
98+ onActivityClick = {
99+ navigator.navigate( Routes . Activity . All )
100+ scope.launch { drawerState.close() }
101+ },
102+ onContactsClick = null , // TODO IMPLEMENT CONTACTS
103+ onProfileClick = null , // TODO IMPLEMENT PROFILE
104+ onWidgetsClick = {
105+ if ( ! hasSeenWidgetsIntro) {
106+ navigator.navigate( Routes . Widgets . Intro )
107+ } else {
108+ navigator.navigate( Routes . Widgets . Add )
109+ }
110+ scope.launch { drawerState.close() }
111+ },
112+ onShopClick = {
113+ if ( ! hasSeenShopIntro) {
114+ navigator.navigate( Routes . Shop . Intro )
115+ } else {
116+ navigator.navigate( Routes . Shop . Discover )
117+ }
118+ scope.launch { drawerState.close() }
119+ },
120+ onSettingsClick = {
121+ navigator.navigate( Routes . Settings . Main )
122+ scope.launch { drawerState.close() }
123+ },
124+ onAppStatusClick = {
125+ navigator.navigate( Routes . AppStatus )
126+ scope.launch { drawerState.close() }
127+ },
128+ )
129+ }
129130 }
130131}
131132
@@ -294,17 +295,19 @@ private fun DrawerItem(
294295@Composable
295296private fun Preview () {
296297 AppThemeSurface {
297- Box {
298- MenuContent (
299- onWalletClick = {},
300- onActivityClick = {},
301- onContactsClick = null ,
302- onProfileClick = null ,
303- onWidgetsClick = {},
304- onShopClick = {},
305- onSettingsClick = {},
306- onAppStatusClick = {},
307- )
298+ Box (modifier = Modifier .fillMaxSize()) {
299+ Box (modifier = Modifier .align(Alignment .TopEnd )) {
300+ MenuContent (
301+ onWalletClick = {},
302+ onActivityClick = {},
303+ onContactsClick = null ,
304+ onProfileClick = null ,
305+ onWidgetsClick = {},
306+ onShopClick = {},
307+ onSettingsClick = {},
308+ onAppStatusClick = {},
309+ )
310+ }
308311 }
309312 }
310313}
0 commit comments