Skip to content

Commit

Permalink
Merge pull request #28
Browse files Browse the repository at this point in the history
Update spacing values for home page
  • Loading branch information
Jacob3075 authored Oct 4, 2022
2 parents 22a1231 + cac87ae commit 6139b61
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ fun HomePageContent(
}

Column(modifier = modifier.statusBarsPadding()) {
when (viewState) {
when (val viewSateInstance = viewState) {
is HomePageViewState.Loading -> HomePageLoading()
is HomePageViewState.Loaded -> HomePageLoaded(
homePageViewState = viewState as HomePageViewState.Loaded,
homePageViewState = viewSateInstance,
navigator = navigator
)

is HomePageViewState.Error -> HomePageError(viewState as HomePageViewState.Error)
is HomePageViewState.Error -> HomePageError(viewSateInstance)
}
}
}
Expand All @@ -76,10 +76,7 @@ private fun HomePageLoaded(
.padding(horizontal = spacing.medium)
.verticalScroll(scrollState)
) {
Spacer(modifier = Modifier.height(spacing.extraSmall))

UserDetailsSection(homePageViewState.userDetails)
Spacer(modifier = Modifier.height(spacing.medium))

TimeSpentCard(
gradient = MaterialTheme.gradients.primary,
Expand All @@ -89,13 +86,13 @@ private fun HomePageLoaded(
time = homePageViewState.contentData.todaysStats.timeSpent,
onClick = navigator::toDetailsPage
)
Spacer(modifier = Modifier.height(spacing.medium))
Spacer(modifier = Modifier.height(spacing.small))

RecentProjects(homePageViewState.contentData.todaysStats)
Spacer(modifier = Modifier.height(spacing.sMedium))
Spacer(modifier = Modifier.height(spacing.extraSmall))

WeeklyReport(homePageViewState.contentData.dailyStats)
Spacer(modifier = Modifier.height(spacing.medium))
Spacer(modifier = Modifier.height(spacing.small))

OtherDailyStatsSection(
homePageViewState.contentData.todaysStats,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fun OtherDailyStatsSection(
Text(text = "Other Daily Stats", style = typography.sectionTitle)
Text(text = "Details", color = colors.primary, style = typography.sectionSubtitle)
}
Spacer(modifier = Modifier.height(spacing.medium))
Spacer(modifier = Modifier.height(spacing.extraSmall))
OtherStatsCard(
gradient = gradients.greenCyan,
iconId = icons.codeFile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ internal fun RecentProjects(
private fun RecentProjectList(
projects: List<Project>,
) = Column(
modifier = Modifier.padding(horizontal = MaterialTheme.spacing.small)
modifier = Modifier.padding(horizontal = MaterialTheme.spacing.small),
verticalArrangement = Arrangement.spacedBy(MaterialTheme.spacing.sMedium)
) {
projects.take(n = 3)
.map { ProjectCardItem(it) }
Expand All @@ -82,7 +83,6 @@ private fun ProjectCardItem(project: Project) {
Box(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = spacing.small)
.shadow(
elevation = 12.dp,
shape = cardShape,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import androidx.compose.ui.text.style.BaselineShift
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import coil.compose.rememberAsyncImagePainter
import coil.request.ImageRequest.Builder
import coil.transform.CircleCropTransformation
Expand Down Expand Up @@ -51,10 +52,11 @@ fun UserDetailsSection(
Text(
text = userDetails?.fullName.orEmpty(),
style = MaterialTheme.typography.pageTitle.copy(
fontSize = 50.sp,
baselineShift = BaselineShift(multiplier = 0.3f),
),
maxLines = 1,
overflow = TextOverflow.Ellipsis
overflow = TextOverflow.Ellipsis,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fun WeeklyReport(
modifier: Modifier = Modifier,
) = Column(
modifier = modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(MaterialTheme.spacing.sMedium),
verticalArrangement = Arrangement.spacedBy(MaterialTheme.spacing.extraSmall),
) {
Row(
verticalAlignment = Alignment.CenterVertically,
Expand Down

0 comments on commit 6139b61

Please sign in to comment.