Skip to content

Commit

Permalink
feature #866: feat FortuneTopBar component
Browse files Browse the repository at this point in the history
  • Loading branch information
chattymin authored and l2hyunwoo committed Sep 24, 2024
1 parent f62b23c commit 58316e3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,20 @@
package org.sopt.official.feature.fortune

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import androidx.navigation.toRoute
import org.sopt.official.designsystem.SoptTheme
import org.sopt.official.feature.fortune.component.FortuneTopBar
import org.sopt.official.feature.fortune.feature.fortundDetail.FortuneDetail
import org.sopt.official.feature.fortune.feature.fortundDetail.FortuneDetailRoute
import org.sopt.official.feature.fortune.feature.home.Home
Expand All @@ -56,18 +51,8 @@ fun MainScreen(
Scaffold(
modifier = Modifier.fillMaxSize(),
topBar = {
Box(modifier = Modifier.fillMaxWidth()) {
Icon(
imageVector = Icons.Filled.Close,
contentDescription = null,
modifier = Modifier
.padding(start = 8.dp, top = 2.dp, bottom = 2.dp)
.padding(8.dp)
.clickable {
// TODO: Navigate to NotificationActivity
},
tint = SoptTheme.colors.onBackground
)
FortuneTopBar {
// TODO: Navigate to NotificationActivity
}
},
content = { paddingValue ->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.sopt.official.feature.fortune.component

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import org.sopt.official.designsystem.SoptTheme

@Composable
fun FortuneTopBar(
modifier: Modifier = Modifier,
onClickNavigationIcon: () -> Unit,
) {
Box(modifier = modifier.fillMaxWidth()) {
Icon(
imageVector = Icons.Filled.Close,
contentDescription = null,
modifier = Modifier
.padding(start = 8.dp, top = 2.dp, bottom = 2.dp)
.padding(8.dp)
.clickable(onClick = onClickNavigationIcon),
tint = SoptTheme.colors.onBackground
)
}
}

0 comments on commit 58316e3

Please sign in to comment.