11package com.gdg.feature.calendar
22
33import androidx.compose.foundation.Image
4- import androidx.compose.foundation.background
5- import androidx.compose.foundation.border
64import androidx.compose.foundation.layout.Arrangement
75import androidx.compose.foundation.layout.Column
86import androidx.compose.foundation.layout.PaddingValues
@@ -17,7 +15,6 @@ import androidx.compose.foundation.layout.size
1715import androidx.compose.foundation.layout.statusBarsPadding
1816import androidx.compose.foundation.lazy.LazyColumn
1917import androidx.compose.foundation.lazy.items
20- import androidx.compose.foundation.shape.RoundedCornerShape
2118import androidx.compose.material3.HorizontalDivider
2219import androidx.compose.material3.Text
2320import androidx.compose.runtime.Composable
@@ -29,8 +26,6 @@ import androidx.compose.runtime.remember
2926import androidx.compose.runtime.setValue
3027import androidx.compose.ui.Alignment
3128import androidx.compose.ui.Modifier
32- import androidx.compose.ui.draw.clip
33- import androidx.compose.ui.res.dimensionResource
3429import androidx.compose.ui.res.painterResource
3530import androidx.compose.ui.res.stringResource
3631import androidx.compose.ui.text.SpanStyle
@@ -47,6 +42,7 @@ import com.gdg.core.state.UiState
4742import com.gdg.core.util.TimeFormatter
4843import com.gdg.domain.entity.ScheduleEntity
4944import com.gdg.feature.R
45+ import com.gdg.feature.calendar.component.CalendarInfoBox
5046import timber.log.Timber
5147import java.time.LocalDate
5248import java.time.YearMonth
@@ -212,80 +208,6 @@ fun CalendarScreen(
212208 }
213209}
214210
215- @Composable
216- fun CalendarInfoBox (data : ScheduleEntity ) {
217- Column (
218- modifier = Modifier
219- .fillMaxWidth()
220- .border(0.5 .dp, CrowdZeroTheme .colors.gray500, shape = RoundedCornerShape (15 .dp))
221- .clip(RoundedCornerShape (15 .dp))
222- .background(CrowdZeroTheme .colors.white)
223- .padding(dimensionResource(R .dimen.default_padding))
224- ) {
225- Row (
226- modifier = Modifier .fillMaxWidth(),
227- verticalAlignment = Alignment .CenterVertically
228- ) {
229- Text (
230- modifier = Modifier .padding(end = 8 .dp),
231- text = data.duration,
232- style = CrowdZeroTheme .typography.c4SemiBold,
233- color = CrowdZeroTheme .colors.green600
234- )
235- Text (
236- text = data.region,
237- style = CrowdZeroTheme .typography.c4SemiBold,
238- color = CrowdZeroTheme .colors.white,
239- modifier = Modifier
240- .background(
241- color = CrowdZeroTheme .colors.green600,
242- shape = RoundedCornerShape (30 .dp)
243- )
244- .padding(horizontal = 8 .dp, vertical = 3 .dp)
245- )
246- }
247- Text (
248- text = data.location.replace(" \n " , " " ),
249- style = CrowdZeroTheme .typography.h5Bold,
250- color = CrowdZeroTheme .colors.gray900
251- )
252- Row (
253- modifier = Modifier .fillMaxWidth(),
254- verticalAlignment = Alignment .CenterVertically
255- ) {
256- Text (
257- modifier = Modifier .padding(end = 4 .dp),
258- text = stringResource(R .string.calendar_people_reporting_title),
259- style = CrowdZeroTheme .typography.c3Regular,
260- color = CrowdZeroTheme .colors.gray600
261- )
262- Text (
263- modifier = Modifier .padding(end = 8 .dp),
264- text = stringResource(R .string.calendar_people_reporting, data.people),
265- style = CrowdZeroTheme .typography.c3Regular,
266- color = CrowdZeroTheme .colors.gray800
267- )
268- Text (
269- modifier = Modifier .padding(end = 8 .dp),
270- text = stringResource(R .string.calendar_slash),
271- style = CrowdZeroTheme .typography.c3Regular,
272- color = CrowdZeroTheme .colors.gray600
273- )
274- Text (
275- modifier = Modifier .padding(end = 4 .dp),
276- text = stringResource(R .string.calendar_jurisdiction),
277- style = CrowdZeroTheme .typography.c3Regular,
278- color = CrowdZeroTheme .colors.gray600
279- )
280- Text (
281- text = data.jurisdiction.replace(" \n " , " " ),
282- style = CrowdZeroTheme .typography.c3Regular,
283- color = CrowdZeroTheme .colors.gray800
284- )
285- }
286- }
287- }
288-
289211@Preview(showBackground = true )
290212@Composable
291213fun CalendarScreenPreview () {
0 commit comments