-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5717f6e
commit 76093d1
Showing
7 changed files
with
122 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
feature/src/main/java/com/terning/feature/calendar/scrap/component/CalendarScrapList.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.terning.feature.calendar.scrap.component | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.rememberScrollState | ||
import androidx.compose.foundation.verticalScroll | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import com.terning.core.designsystem.theme.Black | ||
import com.terning.core.designsystem.theme.TerningTheme | ||
import com.terning.core.extension.getDateStringInKorean | ||
import com.terning.core.extension.isListNotEmpty | ||
import com.terning.domain.entity.response.CalendarScrapDetailModel | ||
import java.time.LocalDate | ||
|
||
@Composable | ||
fun CalendarScrapList( | ||
selectedDate: LocalDate, | ||
scrapList: List<CalendarScrapDetailModel>, | ||
isFromList: Boolean = false, | ||
noScrapScreen: @Composable () -> Unit | ||
) { | ||
val scrollState = rememberScrollState() | ||
|
||
if (scrapList.isListNotEmpty()) { | ||
Text( | ||
text = selectedDate.getDateStringInKorean(), | ||
style = TerningTheme.typography.title5, | ||
color = Black, | ||
modifier = Modifier.padding(start = 24.dp, top = 16.dp, bottom = 15.dp) | ||
) | ||
} | ||
val topModifier = if (!isFromList) { | ||
Modifier | ||
.fillMaxWidth() | ||
.padding(horizontal = 24.dp) | ||
.verticalScroll(scrollState) | ||
} else { | ||
Modifier | ||
.fillMaxWidth() | ||
.padding(horizontal = 24.dp) | ||
} | ||
|
||
if (!scrapList.isListNotEmpty()) { | ||
noScrapScreen() | ||
} else { | ||
Column( | ||
modifier = topModifier | ||
) { | ||
for (scrap in scrapList) { | ||
CalendarScrap( | ||
scrap = scrap | ||
) | ||
Spacer( | ||
modifier = Modifier.height(12.dp) | ||
) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters