@@ -7,18 +7,18 @@ import androidx.compose.foundation.layout.Column
77import androidx.compose.foundation.layout.Spacer
88import androidx.compose.foundation.layout.fillMaxSize
99import androidx.compose.foundation.layout.fillMaxWidth
10- import androidx.compose.foundation.layout.height
1110import androidx.compose.foundation.layout.padding
11+ import androidx.compose.foundation.layout.size
1212import androidx.compose.foundation.shape.RoundedCornerShape
1313import androidx.compose.material3.OutlinedTextField
1414import androidx.compose.material3.OutlinedTextFieldDefaults
1515import androidx.compose.material3.Text
1616import androidx.compose.runtime.Composable
17- import androidx.compose.runtime.derivedStateOf
1817import androidx.compose.runtime.getValue
1918import androidx.compose.runtime.mutableStateOf
2019import androidx.compose.runtime.remember
2120import androidx.compose.runtime.setValue
21+ import androidx.compose.ui.Alignment
2222import androidx.compose.ui.Modifier
2323import androidx.compose.ui.graphics.Color
2424import androidx.compose.ui.text.TextStyle
@@ -27,23 +27,50 @@ import androidx.compose.ui.unit.dp
2727import androidx.compose.ui.unit.sp
2828import org.jetbrains.compose.resources.stringResource
2929import org.jetbrains.compose.ui.tooling.preview.Preview
30+ import org.koin.compose.viewmodel.koinViewModel
31+ import org.whosin.client.data.dto.response.ClubData
32+ import org.whosin.client.presentation.mypage.component.MyClubComponent
3033import org.whosin.client.presentation.mypage.component.MyPageButton
3134import org.whosin.client.presentation.mypage.component.MyPageTopAppBar
3235import whosinclient.composeapp.generated.resources.Res
33- import whosinclient.composeapp.generated.resources.complete_edit
3436import whosinclient.composeapp.generated.resources.edit_my_information
3537import whosinclient.composeapp.generated.resources.my_information
3638import whosinclient.composeapp.generated.resources.nickname
39+
3740@Composable
38- fun MyPageScreen (modifier : Modifier = Modifier , onNavigateToAddClub : () -> Unit ,onNavigateBack : () -> Unit , onNavigateToEdit : () -> Unit ) {
41+ fun MyPageScreen (
42+ modifier : Modifier = Modifier ,
43+ onNavigateToAddClub : () -> Unit ,
44+ onNavigateBack : () -> Unit ,
45+ onNavigateToEdit : () -> Unit
46+ ) {
47+ val viewModel: MyPageViewModel = koinViewModel()
3948 var nickName by remember { mutableStateOf(" 조익성" ) }
49+ val myClubs = listOf (
50+ ClubData (clubId = 1 , clubName = " 메이커스팜" ),
51+ ClubData (clubId = 2 , clubName = " KUIT" ),
52+ ClubData (clubId = 1 , clubName = " 메이커스팜" ),
53+ ClubData (clubId = 2 , clubName = " KUIT" ),
54+ ClubData (clubId = 1 , clubName = " 메이커스팜" ),
55+ ClubData (clubId = 2 , clubName = " KUIT" ),
56+ ClubData (clubId = 1 , clubName = " 메이커스팜" ),
57+ ClubData (clubId = 2 , clubName = " KUIT" ),
58+ ClubData (clubId = 1 , clubName = " 메이커스팜" ),
59+ ClubData (clubId = 2 , clubName = " KUIT" ),
60+ ClubData (clubId = 1 , clubName = " 메이커스팜" ),
61+ ClubData (clubId = 2 , clubName = " KUIT" ),
62+ )
4063 Box (
41- modifier = modifier.fillMaxSize().background(Color .White ).padding(16 .dp)
64+ modifier = modifier
65+ .fillMaxSize()
66+ .background(Color .White )
67+ .padding(16 .dp)
4268 ) {
4369 Column (
44- verticalArrangement = Arrangement .spacedBy( 32 .dp )
70+ modifier = Modifier .fillMaxWidth( )
4571 ) {
4672 MyPageTopAppBar (onNavigateBack)
73+ Spacer (modifier = Modifier .size(16 .dp))
4774 Text (
4875 text = stringResource(Res .string.my_information),
4976 fontSize = 24 .sp,
@@ -52,6 +79,7 @@ fun MyPageScreen(modifier: Modifier = Modifier, onNavigateToAddClub:() -> Unit,o
5279 fontWeight = FontWeight .SemiBold ,
5380 modifier = Modifier .fillMaxWidth()
5481 )
82+ Spacer (modifier = Modifier .size(32 .dp))
5583 Column (
5684 modifier = Modifier .fillMaxWidth()
5785 ) {
@@ -79,23 +107,40 @@ fun MyPageScreen(modifier: Modifier = Modifier, onNavigateToAddClub:() -> Unit,o
79107 shape = RoundedCornerShape (10 .dp)
80108 )
81109 }
110+ Spacer (modifier = Modifier .size(32 .dp))
82111 // 내 동아리 / 학과 목록
83- Column (
84- modifier = Modifier .fillMaxWidth().background(Color .Gray ).height(271 .dp)
85- ) {
86- Text (text = " 내 동아리 / 학과 목록" )
87- }
88- Spacer (modifier = Modifier .weight(1f ))
89- // 내 정보 수정 버튼
90- MyPageButton (onClick = onNavigateToEdit, text = stringResource(Res .string.edit_my_information), enabled = nickName.isNotEmpty())
112+ MyClubComponent (
113+ modifier = Modifier
114+ .fillMaxWidth()
115+ .weight(1f )
116+ .padding(bottom = 72 .dp),
117+ myClubs = myClubs,
118+ onDeleteClub = {
119+ // TODO: 동아리 삭제
120+ // viewModel.deleteClub(it)
121+ },
122+ onNavigateToAddClub = onNavigateToAddClub
123+ )
91124 }
125+
126+ // 내 정보 수정 버튼 - 하단에 고정
127+ MyPageButton (
128+ onClick = onNavigateToEdit,
129+ text = stringResource(Res .string.edit_my_information),
130+ enabled = nickName.isNotEmpty(),
131+ modifier = Modifier .align(Alignment .BottomCenter )
132+ )
92133 }
93134
94135}
95136
96137@Preview
97138@Composable
98139private fun MyPageScreenPreview () {
99- MyPageScreen (onNavigateBack = {}, onNavigateToEdit = {}, onNavigateToAddClub = {} )
140+ MyPageScreen (
141+ onNavigateBack = {},
142+ onNavigateToEdit = {},
143+ onNavigateToAddClub = {}
144+ )
100145}
101146
0 commit comments