From cc205b163c143eace3ceef9ae4d2d76d8f33f827 Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Fri, 12 Jul 2024 02:34:47 +0900 Subject: [PATCH 1/6] =?UTF-8?q?[FEAT/#52]=20=EC=98=A4=EB=8A=98=20=EB=A7=88?= =?UTF-8?q?=EA=B0=90=20=EA=B3=B5=EA=B3=A0=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/home/component/HomeTodayIntern.kt | 7 +- .../home/component/HomeTodayInternItem.kt | 67 ++++++++----------- 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayIntern.kt b/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayIntern.kt index 926ea1b83..020818052 100644 --- a/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayIntern.kt +++ b/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayIntern.kt @@ -8,6 +8,7 @@ import androidx.compose.foundation.lazy.LazyRow import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp +import com.terning.core.designsystem.theme.CalYellow @Composable fun HomeTodayIntern() { @@ -18,8 +19,10 @@ fun HomeTodayIntern() { .fillMaxWidth() .padding(top = 19.dp), ) { - items(5) { - HomeTodayInternItem("[유한킴벌리] 그린캠프 w.대학생 숲활동가 모집") + items(todayInternItemCount) { + HomeTodayInternItem("[유한킴벌리] 그린캠프 w.대학생 숲활동가 모집", CalYellow) } } } + +private const val todayInternItemCount = 5 \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayInternItem.kt b/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayInternItem.kt index 59073da93..4c8413791 100644 --- a/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayInternItem.kt +++ b/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayInternItem.kt @@ -1,59 +1,50 @@ package com.terning.feature.home.home.component -import androidx.compose.foundation.background -import androidx.compose.foundation.border -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width -import androidx.compose.foundation.shape.RoundedCornerShape 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.unit.dp +import com.terning.core.designsystem.component.box.ScrapBox +import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.Grey150 -import com.terning.core.designsystem.theme.Grey500 import com.terning.core.designsystem.theme.TerningTheme -import com.terning.core.designsystem.theme.White @Composable fun HomeTodayInternItem( title: String, + scrapColor: Color, modifier: Modifier = Modifier ) { - Row( - modifier - .background(White) - .width(140.dp) + ScrapBox( + modifier = modifier .height(116.dp) - .border( - width = 1.dp, - color = Grey150, - RoundedCornerShape(5.dp), - ), - verticalAlignment = Alignment.Bottom - ) { - Box( - modifier - .background( - color = Grey500, - shape = RoundedCornerShape( - topStart = 5.dp, - bottomStart = 5.dp - ) + .width(140.dp), + cornerRadius = 5.dp, + scrapColor = scrapColor, + borderWidth = 1.dp, + borderColor = Grey150, + content = { + Column( + modifier = modifier + .fillMaxHeight(), + verticalArrangement = Arrangement.Bottom + ) { + Text( + text = title, + modifier = modifier + .padding(start = 8.dp, end = 9.dp, bottom = 8.dp), + style = TerningTheme.typography.button3, + color = Black, + maxLines = 3, ) - .width(8.dp) - .fillMaxHeight() - ) - Text( - text = title, - modifier - .padding(horizontal = 16.dp) - .padding(bottom = 8.dp), - style = TerningTheme.typography.button3 - ) - } + } + } + ) } \ No newline at end of file From 40932d87b4995616b92e4c18c7e927e2b556b3c2 Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Fri, 12 Jul 2024 02:40:18 +0900 Subject: [PATCH 2/6] =?UTF-8?q?[CHORE/#52]=20padding=20=EC=9C=84=EC=B9=98?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/terning/feature/home/home/HomeRoute.kt | 7 ++++--- .../terning/feature/home/home/component/HomeTodayIntern.kt | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt index bc8c30273..50ef5b33d 100644 --- a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt @@ -49,9 +49,10 @@ fun HomeScreen() { ) { Text( text = stringResource( - id = R.string.home_today_title,"남지우"), + id = R.string.home_today_title, "남지우" + ), modifier = Modifier - .padding(top = 11.dp) + .padding(top = 11.dp, bottom = 19.dp) .padding(horizontal = 24.dp), style = TerningTheme.typography.title1, color = Black, @@ -69,7 +70,7 @@ fun HomeScreen() { style = TerningTheme.typography.detail2, color = Black, modifier = Modifier - .padding(top = 25.dp) + .padding(top = 9.dp) .padding(horizontal = 24.dp), ) diff --git a/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayIntern.kt b/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayIntern.kt index 020818052..35ad92071 100644 --- a/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayIntern.kt +++ b/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayIntern.kt @@ -3,7 +3,6 @@ package com.terning.feature.home.home.component import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyRow import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -16,8 +15,7 @@ fun HomeTodayIntern() { horizontalArrangement = Arrangement.spacedBy(12.dp), contentPadding = PaddingValues(horizontal = 24.dp), modifier = Modifier - .fillMaxWidth() - .padding(top = 19.dp), + .fillMaxWidth(), ) { items(todayInternItemCount) { HomeTodayInternItem("[유한킴벌리] 그린캠프 w.대학생 숲활동가 모집", CalYellow) From 28037ed9a449484dfe67993528a1b2a154c8111b Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Fri, 12 Jul 2024 03:03:08 +0900 Subject: [PATCH 3/6] =?UTF-8?q?[FEAT/#52]=20=EA=B3=B5=EA=B3=A0=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC=20=EB=B0=94=ED=85=80=EC=8B=9C=ED=8A=B8=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../terning/feature/home/home/HomeRoute.kt | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt index 50ef5b33d..b0845f061 100644 --- a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt @@ -2,7 +2,10 @@ package com.terning.feature.home.home import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding @@ -11,9 +14,16 @@ import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import com.terning.core.designsystem.component.bottomsheet.SortingBottomSheet +import com.terning.core.designsystem.component.button.SortingButton import com.terning.core.designsystem.component.topappbar.LogoTopAppBar import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.Grey150 @@ -25,12 +35,30 @@ import com.terning.feature.home.home.component.HomeTodayIntern @Composable fun HomeRoute() { - HomeScreen() + val currentSortBy: MutableState = remember { + mutableStateOf(0) + } + + HomeScreen(currentSortBy) } @OptIn(ExperimentalFoundationApi::class) @Composable -fun HomeScreen() { +fun HomeScreen( + currentSortBy: MutableState, +) { + var sheetState by remember { mutableStateOf(false) } + + if (sheetState) { + SortingBottomSheet( + onDismiss = { + sheetState = false + }, + currentSortBy = currentSortBy.value, + newSortBy = currentSortBy + ) + } + Scaffold( modifier = Modifier, topBar = { @@ -96,6 +124,20 @@ fun HomeScreen() { modifier = Modifier .fillMaxWidth(), ) + + Row( + modifier = Modifier + .fillMaxWidth(), + horizontalArrangement = Arrangement.End, + ) { + SortingButton( + sortBy = currentSortBy.value, + onCLick = { sheetState = true }, + modifier = Modifier + .padding(vertical = 4.dp) + ) + Spacer(modifier = Modifier.padding(9.dp)) + } } } From cdf69f58f06c99cdb3838324258b9ed22ac3811a Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Fri, 12 Jul 2024 06:27:21 +0900 Subject: [PATCH 4/6] =?UTF-8?q?[CHORE/#52]=20conflict=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../terning/feature/home/home/component/HomeTodayInternItem.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayInternItem.kt b/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayInternItem.kt index 4c8413791..329467e18 100644 --- a/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayInternItem.kt +++ b/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayInternItem.kt @@ -11,7 +11,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp -import com.terning.core.designsystem.component.box.ScrapBox +import com.terning.core.designsystem.component.item.ScrapBox import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.Grey150 import com.terning.core.designsystem.theme.TerningTheme From ae7cc9b7824ad84a177f170e048a61506d1a4f74 Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Fri, 12 Jul 2024 06:30:12 +0900 Subject: [PATCH 5/6] =?UTF-8?q?[FEAT/#52]=20=ED=95=84=ED=84=B0=EB=A7=81=20?= =?UTF-8?q?=EA=B3=B5=EA=B3=A0=20=EC=95=84=EC=9D=B4=ED=85=9C=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../terning/feature/home/home/HomeRoute.kt | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt index b0845f061..63c015970 100644 --- a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt @@ -3,13 +3,17 @@ package com.terning.feature.home.home import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row 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.foundation.lazy.LazyColumn +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Scaffold import androidx.compose.material3.Text @@ -24,11 +28,14 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.terning.core.designsystem.component.bottomsheet.SortingBottomSheet import com.terning.core.designsystem.component.button.SortingButton +import com.terning.core.designsystem.component.item.InternItem import com.terning.core.designsystem.component.topappbar.LogoTopAppBar import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.Grey150 +import com.terning.core.designsystem.theme.Grey200 import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.designsystem.theme.White +import com.terning.core.extension.customShadow import com.terning.feature.R import com.terning.feature.home.home.component.HomeFilteringScreen import com.terning.feature.home.home.component.HomeTodayIntern @@ -46,6 +53,7 @@ fun HomeRoute() { @Composable fun HomeScreen( currentSortBy: MutableState, + modifier: Modifier = Modifier, ) { var sheetState by remember { mutableStateOf(false) } @@ -68,7 +76,9 @@ fun HomeScreen( LazyColumn( modifier = Modifier .fillMaxSize() - .padding(top = paddingValues.calculateTopPadding()) + .padding(top = paddingValues.calculateTopPadding()), + contentPadding = PaddingValues(2.dp), + verticalArrangement = Arrangement.spacedBy(12.dp) ) { item { Column( @@ -141,16 +151,32 @@ fun HomeScreen( } } - items(10) { - TerningPostItem( - imageUrl = "https://reqres.in/img/faces/7-image.jpg", - title = "[Someone] 콘텐츠 마케터 대학생 인턴 채용", - dateDeadline = "2", - workingPeriod = "2개월", - isScraped = false, - ) + items(itemCount) { + Box( + modifier = modifier + .height(92.dp) + .padding(horizontal = 24.dp) + .customShadow( + color = Grey200, + shadowRadius = 10.dp, + shadowWidth = 2.dp + ) + .background( + color = White, + shape = RoundedCornerShape(10.dp) + ) + ) { + InternItem( + imageUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[Someone] 콘텐츠 마케터 대학생 인턴 채용", + dateDeadline = "2", + workingPeriod = "2", + isScraped = false, + ) + } } } - } } + +private const val itemCount = 10 \ No newline at end of file From 35de355299030ee33cfd9bc72785a34f4d895a7b Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Fri, 12 Jul 2024 22:07:31 +0900 Subject: [PATCH 6/6] =?UTF-8?q?[CHORE/#52]=20=EC=A4=84=EB=B0=94=EA=BF=88?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/home/home/component/HomeTodayInternItem.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayInternItem.kt b/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayInternItem.kt index 329467e18..f97e42b1d 100644 --- a/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayInternItem.kt +++ b/feature/src/main/java/com/terning/feature/home/home/component/HomeTodayInternItem.kt @@ -39,7 +39,11 @@ fun HomeTodayInternItem( Text( text = title, modifier = modifier - .padding(start = 8.dp, end = 9.dp, bottom = 8.dp), + .padding( + start = 8.dp, + end = 9.dp, + bottom = 8.dp + ), style = TerningTheme.typography.button3, color = Black, maxLines = 3,