Skip to content

Commit

Permalink
refactor - 컴포저블 함수 네이밍 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hoyahozz committed Jun 30, 2022
1 parent 0bb04d1 commit 34e1dd6
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fun HomeScreen(
Scaffold(
backgroundColor = BackgroundColor1,
topBar = {
HomeAppBar(
HomeUserProfile(
userName = "김정호",
onUserIconClick = { /* TODO */ }
)
Expand All @@ -73,15 +73,15 @@ fun HomeScreen(
) {
HomeTopBox(loginState = viewState.loginState)
Spacer(modifier = Modifier.padding(8.dp))
HomeBottomBox()
HomeMonthlyPlan()
Spacer(modifier = Modifier.padding(20.dp))
}
}
}

// TODO : 클릭 시 내 정보 화면으로 네비게이션 (정호)
@Composable
private fun HomeAppBar(
private fun HomeUserProfile(
modifier: Modifier = Modifier,
userName: String,
onUserIconClick: () -> Unit,
Expand Down Expand Up @@ -125,14 +125,14 @@ private fun HomeAppBar(
@Composable
fun HomeTopBox(loginState: HomeContract.LoginState) {
when (loginState) {
HomeContract.LoginState.LOGIN -> HomeIsLoginBox()
HomeContract.LoginState.NONE -> HomeIsNotLoginBox()
HomeContract.LoginState.LOGIN -> HomeTodayPlan()
HomeContract.LoginState.NONE -> HomeInduceLogin()
}
}

// TODO : 약속 수 들어가는 로직 넣기 (정호)
@Composable
fun HomeIsLoginBox() {
fun HomeTodayPlan() {
var expanded by remember { mutableStateOf(false) }
Surface(
color = Color.White,
Expand Down Expand Up @@ -188,10 +188,10 @@ fun HomeIsLoginBox() {
// TODO : API 연동
if (expanded) {
for (i in 0 until 3) {
ItemTodayPlan()
HomeTodayPlanItem()
}
} else {
ItemTodayPlan()
HomeTodayPlanItem()
}
}
}
Expand Down Expand Up @@ -219,7 +219,7 @@ fun HomeIsLoginBox() {


@Composable
fun HomeIsNotLoginBox() {
fun HomeInduceLogin() {
Box(
modifier = Modifier
.height(60.dp)
Expand Down Expand Up @@ -256,7 +256,7 @@ fun HomeIsNotLoginBox() {
}

@Composable
fun HomeBottomBox() {
fun HomeMonthlyPlan() {
var isCalendarMode by remember { mutableStateOf(true) }
var expanded by remember { mutableStateOf(false) }

Expand Down Expand Up @@ -365,7 +365,7 @@ fun HomeBottomBox() {
Divider(color = Gray200, thickness = 1.dp)
Spacer(modifier = Modifier.padding(top = 10.dp))
if (isCalendarMode) {
PlanCalendar(currentDate)
PlanzCalendar(currentDate)
} else {
Column(
modifier = Modifier.padding(top = 11.dp, bottom = 12.dp),
Expand All @@ -374,11 +374,11 @@ fun HomeBottomBox() {
if (expanded) {
// TODO : 예시 화면 (정호)
for (i in 0 until 10) {
ItemTextPlan("그로스 회의회의")
HomeMonthlyPlanItem("그로스 회의회의")
}
} else {
for (i in 0 until 4) {
ItemTextPlan("그로스 회의회의")
HomeMonthlyPlanItem("그로스 회의회의")
}
}
}
Expand Down Expand Up @@ -408,7 +408,7 @@ fun HomeBottomBox() {

// TODO : 추후 공통 컴포넌트로 이동 (정호)
@Composable
fun PlanCalendar(
fun PlanzCalendar(
currentDate: CalendarDay
) {
val context = LocalContext.current
Expand Down Expand Up @@ -440,7 +440,7 @@ fun PlanCalendar(

// TODO : API 연동 및 매개변수 추가(정호)
@Composable
fun ItemTodayPlan() {
fun HomeTodayPlanItem() {
Box(
modifier = Modifier
.fillMaxWidth()
Expand Down Expand Up @@ -477,7 +477,7 @@ fun ItemTodayPlan() {

// TODO : API 연동 및 매개변수 추가 (정호)
@Composable
fun ItemTextPlan(content: String) {
fun HomeMonthlyPlanItem(content: String) {
Box(
modifier = Modifier
.fillMaxWidth(),
Expand Down

0 comments on commit 34e1dd6

Please sign in to comment.