Skip to content
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.byeboo.app.core.designsystem.component.topbar

import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.TextStyle
import com.byeboo.app.R
import com.byeboo.app.core.designsystem.ui.theme.ByeBooTheme
import com.byeboo.app.core.util.noRippleClickable

@Composable
fun BackTopbar(
onBackClick: () -> Unit,
modifier: Modifier = Modifier,
title: String? = null,
textColor: Color = ByeBooTheme.colors.white,
textStyle: TextStyle = ByeBooTheme.typography.sub1,
) {
ByeBooTopbar(
title = title,
textColor = textColor,
textStyle = textStyle,
navigationIcon = {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_left),
contentDescription = null,
tint = ByeBooTheme.colors.gray50,
modifier =
Modifier
.noRippleClickable(onClick = onBackClick),
)
},
modifier = modifier,
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.byeboo.app.core.designsystem.component.topbar

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
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.text.TextStyle
import androidx.compose.ui.unit.dp
import com.byeboo.app.core.designsystem.ui.theme.ByeBooTheme
import com.byeboo.app.core.util.screenHeightDp

@Composable
fun ByeBooTopbar(
modifier: Modifier = Modifier,
title: String? = null,
textColor: Color = ByeBooTheme.colors.gray50,
textStyle: TextStyle = ByeBooTheme.typography.sub1,
navigationIcon: @Composable () -> Unit = {},
actions: @Composable () -> Unit = {},
backgroundColor: Color = ByeBooTheme.colors.background,
) {
Box(
modifier =
modifier
.fillMaxWidth()
.background(backgroundColor)
.padding(bottom = screenHeightDp(16.dp)),
) {
Row(
modifier = Modifier.align(Alignment.CenterStart),
verticalAlignment = Alignment.CenterVertically,
) {
navigationIcon()
}

if (title != null) {
Text(
modifier = Modifier.align(Alignment.Center),
text = title,
color = textColor,
style = textStyle,
)
}

Row(
modifier = Modifier.align(Alignment.CenterEnd),
verticalAlignment = Alignment.CenterVertically,
) {
actions()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.byeboo.app.core.designsystem.component.topbar

import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.TextStyle
import com.byeboo.app.R
import com.byeboo.app.core.designsystem.ui.theme.ByeBooTheme
import com.byeboo.app.core.util.noRippleClickable

@Composable
fun CloseTopbar(
onCloseClick: () -> Unit,
modifier: Modifier = Modifier,
title: String? = null,
textColor: Color = ByeBooTheme.colors.white,
textStyle: TextStyle = ByeBooTheme.typography.sub1,
) {
ByeBooTopbar(
title = title,
textColor = textColor,
textStyle = textStyle,
actions = {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_cancel),
contentDescription = null,
tint = ByeBooTheme.colors.white,
modifier =
Modifier.noRippleClickable(
onClick = onCloseClick,
),
)
},
modifier = modifier,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.byeboo.app.R
import com.byeboo.app.core.designsystem.component.topbar.ByeBooTopbar
import com.byeboo.app.core.designsystem.event.LocalSnackBarTrigger
import com.byeboo.app.core.designsystem.ui.theme.ByeBooTheme
import com.byeboo.app.core.util.hasNotificationPermission
Expand Down Expand Up @@ -253,18 +253,7 @@ private fun MyPageScreen(
bottom = paddingValues.calculateBottomPadding(),
),
) {
Text(
text = "내 정보",
color = ByeBooTheme.colors.white,
style = ByeBooTheme.typography.sub1,
textAlign = TextAlign.Center,
modifier =
Modifier
.fillMaxWidth()
.background(ByeBooTheme.colors.background)
.padding(horizontal = screenWidthDp(24.dp))
.padding(top = screenHeightDp(43.dp), bottom = screenHeightDp(16.dp)),
)
MyPageTopbar()

LazyColumn(
modifier = Modifier.fillMaxWidth(),
Expand Down Expand Up @@ -357,6 +346,19 @@ private fun MyPageScreen(
}
}

@Composable
private fun MyPageTopbar(modifier: Modifier = Modifier) {
ByeBooTopbar(
title = "내 정보",
textColor = ByeBooTheme.colors.gray50,
textStyle = ByeBooTheme.typography.sub1,
modifier =
modifier
.padding(horizontal = screenWidthDp(24.dp))
.padding(top = screenHeightDp(43.dp)),
)
}

@Composable
private fun NicknameSection(
onNicknameChangeClick: () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
package com.byeboo.app.presentation.mypage.editprofile

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
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.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.nativeKeyCode
import androidx.compose.ui.input.key.onPreInterceptKeyBeforeSoftKeyboard
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.byeboo.app.R
import com.byeboo.app.core.designsystem.component.button.ByeBooActivationButton
import com.byeboo.app.core.designsystem.component.topbar.BackTopbar
import com.byeboo.app.core.designsystem.event.LocalSnackBarTrigger
import com.byeboo.app.core.designsystem.ui.theme.ByeBooTheme
import com.byeboo.app.core.util.noRippleClickable
import com.byeboo.app.core.util.screenHeightDp
import com.byeboo.app.core.util.screenWidthDp
import com.byeboo.app.domain.model.auth.NicknameValidationResult
Expand Down Expand Up @@ -110,29 +102,10 @@ private fun EditProfileScreen(
),
),
) {
Box(
modifier =
Modifier
.fillMaxWidth()
.padding(bottom = screenHeightDp(16.dp)),
) {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_left),
contentDescription = null,
tint = ByeBooTheme.colors.gray50,
modifier =
Modifier
.noRippleClickable(onClick = onBackClick),
)

Text(
text = "프로필 수정",
style = ByeBooTheme.typography.sub1,
color = ByeBooTheme.colors.white,
textAlign = TextAlign.Center,
modifier = Modifier.align(Alignment.Center),
)
}
BackTopbar(
onBackClick = onBackClick,
title = "프로필 수정",
)

Spacer(modifier = Modifier.height(screenHeightDp(8.dp)))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ 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.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -30,12 +29,10 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.TransformOrigin
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.PlatformTextStyle
import androidx.compose.ui.text.rememberTextMeasurer
Expand All @@ -53,9 +50,9 @@ import com.airbnb.lottie.compose.animateLottieCompositionAsState
import com.airbnb.lottie.compose.rememberLottieComposition
import com.byeboo.app.R
import com.byeboo.app.core.designsystem.component.button.ByeBooButton
import com.byeboo.app.core.designsystem.component.topbar.CloseTopbar
import com.byeboo.app.core.designsystem.event.LocalSnackBarTrigger
import com.byeboo.app.core.designsystem.ui.theme.ByeBooTheme
import com.byeboo.app.core.util.noRippleClickable
import com.byeboo.app.core.util.screenHeightDp
import com.byeboo.app.core.util.screenWidthDp
import com.byeboo.app.presentation.offboarding.component.OffboardingNewJourneyButton
Expand Down Expand Up @@ -146,24 +143,16 @@ private fun OffboardingCompleteGuideScreen(
),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_cancel),
contentDescription = null,
tint = ByeBooTheme.colors.white,
modifier =
Modifier
.size(24.dp)
.align(Alignment.End)
.noRippleClickable(onCloseClick),
CloseTopbar(
onCloseClick = onCloseClick,
)

Spacer(modifier = Modifier.height(screenHeightDp(34.dp)))

Column(
modifier =
Modifier
.fillMaxWidth()
.height(screenHeightDp(156.dp)),
.height(screenHeightDp(156.dp))
.padding(vertical = screenHeightDp(18.dp)),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
Expand Down
Loading