Skip to content

Commit

Permalink
Merge branch 'main' into feature-FinishingTaskfoBelindas-#169
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorpapke authored Dec 4, 2023
2 parents 3fa18e9 + 8d85c45 commit 5ea833b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 9 deletions.
6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

40 changes: 37 additions & 3 deletions app/src/main/java/com/example/belindas_closet/screen/AdminView.kt
Original file line number Diff line number Diff line change
@@ -1,36 +1,70 @@
package com.example.belindas_closet.screen

import android.widget.Toast
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.Edit
import androidx.compose.material.icons.filled.ExitToApp
import androidx.compose.material.icons.filled.Menu
import androidx.compose.material3.Button
import androidx.compose.material3.DrawerValue
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavHostController
import com.example.belindas_closet.MainActivity
import com.example.belindas_closet.R
import com.example.belindas_closet.Routes

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun AdminView(navController: NavHostController) {
val current = LocalContext.current
Row(
modifier = Modifier
.size(125.dp)
.padding(top = 10.dp, start = 10.dp),
.height(75.dp)
.padding(10.dp)
.fillMaxWidth(),
verticalAlignment = Alignment.Top,
horizontalArrangement = Arrangement.Start
horizontalArrangement = Arrangement.SpaceBetween
) {
NSCLogo()
Icon(Icons.Filled.ExitToApp, contentDescription="Logout",
modifier = Modifier.clickable {
MainActivity.getPref().edit().remove("token").commit()
MainActivity.getPref().edit().remove("userRole").commit()
navController.navigate(Routes.Home.route)
Toast.makeText(
current,
"Logged Out",
Toast.LENGTH_SHORT
).show()
})
}
Row(
modifier = Modifier
Expand Down

0 comments on commit 5ea833b

Please sign in to comment.