Skip to content

Commit

Permalink
feat/#11: 회원 정보 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
youjin09222 committed May 3, 2024
1 parent 18d2d22 commit 012559a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sopt.now.compose
package com.sopt.now.compose.presentation

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
Expand All @@ -8,16 +8,17 @@ import com.sopt.now.compose.item.FriendItem
import com.sopt.now.compose.item.Profile
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.sopt.now.compose.R
import com.sopt.now.compose.item.UserItem
import com.sopt.now.compose.ui.theme.NOWSOPTAndroidTheme

@Composable
fun HomeView() {
fun HomeView(userName: String, userPhone: String) {
LazyColumn(
modifier = Modifier.fillMaxSize()
) {
item {
UserItem(friendList.first())
UserItem(Profile(R.drawable.iv_user_profile, userName, userPhone))
}

// 첫 번째 요소는 건너뛰고 적용
Expand Down Expand Up @@ -101,6 +102,6 @@ val friendList = listOf(
@Composable
fun HomePreview() {
NOWSOPTAndroidTheme {
HomeView()
HomeView("","")
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sopt.now.compose
package com.sopt.now.compose.presentation

import android.util.Log
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -14,10 +15,12 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.sopt.now.compose.R
import com.sopt.now.compose.ui.theme.NOWSOPTAndroidTheme

@Composable
fun MyPageView(userId: String, userPw: String, userName: String, userDescription: String) {
fun MyPageView(userId: String, userPw: String, userPhone: String) {
Log.d("myPage", "${userId}")
Column(
modifier = Modifier
.fillMaxSize()
Expand All @@ -35,7 +38,7 @@ fun MyPageView(userId: String, userPw: String, userName: String, userDescription
)
Spacer(modifier = Modifier.width(20.dp))
Text(
text = userName,
text = userPhone,
fontSize = 20.sp
)
}
Expand All @@ -52,11 +55,12 @@ fun MyPageView(userId: String, userPw: String, userName: String, userDescription
Spacer(modifier = Modifier.height(30.dp))
UserInfoItem(
label = stringResource(id = R.string.tv_user_description),
value = userDescription
value = userPhone
)
}
}


@Composable
fun UserInfoItem(label: String, value: String) {
Column {
Expand All @@ -77,6 +81,6 @@ fun UserInfoItem(label: String, value: String) {
@Composable
fun MyPagePreview() {
NOWSOPTAndroidTheme {
MyPageView("myPageSopt", "mypagePassword123", "MyPageUserName", "INFJ 입니다!")
MyPageView("myPageSopt", "mypagePassword123", "MyPageUserName")
}
}
}

0 comments on commit 012559a

Please sign in to comment.