Skip to content

Commit

Permalink
[MERGE] #80 -> develop
Browse files Browse the repository at this point in the history
[UI/#80] 탐색 뷰 / 공고 컴포넌트 추가
  • Loading branch information
arinming authored Jul 15, 2024
2 parents 5cfdab5 + 12a396e commit 5eded85
Show file tree
Hide file tree
Showing 12 changed files with 261 additions and 97 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.terning.core.designsystem.component.item

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.terning.core.designsystem.theme.Grey200
import com.terning.core.designsystem.theme.White
import com.terning.core.extension.customShadow

@Composable
fun InternItemWithShadow(
imageUrl: String,
title: String,
dateDeadline: String,
workingPeriod: String,
isScraped: Boolean,
) {
Box(
modifier = Modifier
.customShadow(
color = Grey200,
shadowRadius = 10.dp,
shadowWidth = 2.dp,
)
.background(
color = White,
shape = RoundedCornerShape(10.dp)
)
) {
InternItem(
imageUrl = imageUrl,
title = title,
dateDeadline = dateDeadline,
workingPeriod = workingPeriod,
isScraped = isScraped
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ fun TerningBasicTextField(
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(4.dp),
modifier = Modifier.padding(vertical = 8.dp)
) {
helperIcon?.let {
Icon(
Expand Down
43 changes: 12 additions & 31 deletions feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
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
Expand All @@ -31,22 +30,19 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.NavHostController
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.item.InternItemWithShadow
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.changefilter.navigation.navigateChangeFilter
import com.terning.feature.home.home.component.HomeFilteringEmptyIntern
import com.terning.feature.home.home.component.HomeFilteringScreen
import com.terning.feature.home.home.component.HomeRecommendEmptyIntern
import com.terning.feature.home.home.component.HomeTodayEmptyIntern
import com.terning.feature.home.home.component.HomeTodayIntern
import com.terning.feature.home.home.model.RecommendInternData
import com.terning.feature.home.home.model.UserNameState
import com.terning.feature.home.home.model.UserScrapState

Expand Down Expand Up @@ -148,7 +144,17 @@ fun HomeScreen(

if (userNameState.internFilter != null && recommendInternData.isNotEmpty()) {
items(recommendInternData.size) { index ->
ShowRecommendIntern(recommendInternData[index])
Box(
modifier = Modifier.padding(horizontal = 24.dp)
) {
InternItemWithShadow(
imageUrl = recommendInternData[index].imgUrl,
title = recommendInternData[index].title,
dateDeadline = recommendInternData[index].dDay.toString(),
workingPeriod = recommendInternData[index].workingPeriod.toString(),
isScraped = recommendInternData[index].isScrapped,
)
}
}
}
}
Expand Down Expand Up @@ -243,29 +249,4 @@ private fun ShowInternFilter(userNameState: UserNameState, onChangeFilterClick:
)
}
}
}

@Composable
private fun ShowRecommendIntern(recommendInternData: RecommendInternData) {
Box(
modifier = Modifier
.padding(horizontal = 24.dp)
.customShadow(
color = Grey200,
shadowRadius = 10.dp,
shadowWidth = 2.dp
)
.background(
color = White,
shape = RoundedCornerShape(10.dp)
)
) {
InternItem(
imageUrl = recommendInternData.imgUrl,
title = recommendInternData.title,
dateDeadline = recommendInternData.dDay.toString(),
workingPeriod = recommendInternData.workingPeriod.toString(),
isScraped = recommendInternData.isScrapped,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import com.terning.core.designsystem.theme.CalGreen2
import com.terning.core.designsystem.theme.CalOrange1
import com.terning.core.designsystem.theme.CalPink
import com.terning.core.designsystem.theme.CalYellow
import com.terning.feature.home.home.model.InternData
import com.terning.feature.home.home.model.InternFilterData
import com.terning.feature.home.home.model.RecommendInternData
import com.terning.feature.home.home.model.ScrapData
import com.terning.feature.home.home.model.UserNameState
import com.terning.feature.home.home.model.UserScrapState
Expand All @@ -24,7 +24,7 @@ import javax.inject.Inject
class HomeViewModel @Inject constructor(

) : ViewModel() {
private val _userName by mutableStateOf<UserNameState>(
private val _userName by mutableStateOf(
UserNameState(
userName = "남지우자랑스러운티엘이되",
internFilter = InternFilterData(
Expand All @@ -37,15 +37,15 @@ class HomeViewModel @Inject constructor(
)
val userName get() = _userName

private val _scrapState = MutableStateFlow<UserScrapState>(
private val _scrapState = MutableStateFlow(
UserScrapState(
isScrapExist = true,
scrapData = getScrapData()
)
)
val scrapData get() = _scrapState.asStateFlow()

private val _recommendInternState = MutableStateFlow<List<RecommendInternData>>(
private val _recommendInternState = MutableStateFlow(
getRecommendData()
)
val recommendInternData get() = _recommendInternState.asStateFlow()
Expand All @@ -57,7 +57,6 @@ class HomeViewModel @Inject constructor(
fun setWorkingPeriod(workingPeriod: Int) {
userName.internFilter?.workingPeriod = workingPeriod
}

}

private fun getScrapData(): List<ScrapData> = listOf(
Expand Down Expand Up @@ -111,71 +110,71 @@ private fun getScrapData(): List<ScrapData> = listOf(
),
)

private fun getRecommendData(): List<RecommendInternData> = listOf(
RecommendInternData(
private fun getRecommendData(): List<InternData> = listOf(
InternData(
imgUrl = "https://reqres.in/img/faces/7-image.jpg",
title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가",
dDay = 22,
workingPeriod = 2,
isScrapped = true,
),
RecommendInternData(
InternData(
imgUrl = "https://reqres.in/img/faces/7-image.jpg",
title = "ㅇㄻㅇㅁㄻㄹㅇㅁㅇㄹ",
dDay = 9,
workingPeriod = 6,
isScrapped = false,
),
RecommendInternData(
InternData(
imgUrl = "https://reqres.in/img/faces/7-image.jpg",
title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가",
dDay = 2,
workingPeriod = 4,
isScrapped = true,
),
RecommendInternData(
InternData(
imgUrl = "https://reqres.in/img/faces/7-image.jpg",
title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가",
dDay = 2,
workingPeriod = 4,
isScrapped = false,
),
RecommendInternData(
InternData(
imgUrl = "https://reqres.in/img/faces/7-image.jpg",
title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가",
dDay = 2,
workingPeriod = 4,
isScrapped = true,
),
RecommendInternData(
InternData(
imgUrl = "https://reqres.in/img/faces/7-image.jpg",
title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가",
dDay = 2,
workingPeriod = 4,
isScrapped = true,
),
RecommendInternData(
InternData(
imgUrl = "https://reqres.in/img/faces/7-image.jpg",
title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가",
dDay = 2,
workingPeriod = 4,
isScrapped = false,
),
RecommendInternData(
InternData(
imgUrl = "https://reqres.in/img/faces/7-image.jpg",
title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가",
dDay = 2,
workingPeriod = 4,
isScrapped = true,
),
RecommendInternData(
InternData(
imgUrl = "https://reqres.in/img/faces/7-image.jpg",
title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가",
dDay = 2,
workingPeriod = 4,
isScrapped = false,
),
RecommendInternData(
InternData(
imgUrl = "https://reqres.in/img/faces/7-image.jpg",
title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가",
dDay = 2,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.terning.feature.home.home.model

data class RecommendInternData(
data class InternData(
val imgUrl: String,
val title: String,
val dDay: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fun InternCompanyInfo(modifier: Modifier) {
) {
Image(
painter = painterResource(
id = R.drawable.ic_nosearch
id = R.drawable.ic_empty_logo
),
modifier = modifier.fillMaxWidth(),
contentDescription = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MainNavigator(
@Composable get() = navController
.currentBackStackEntryAsState().value?.destination

val startDestination = SignIn
val startDestination = Search

val currentTab: MainTab?
@Composable get() = MainTab.find { tab ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,4 @@ fun SearchScreen(
SearchInternList(type = InternListType.SCRAP)
}
}

}
Loading

0 comments on commit 5eded85

Please sign in to comment.