Skip to content

Commit

Permalink
Merge pull request #126 from joelkanyi/add-first-task-button
Browse files Browse the repository at this point in the history
make Add first task more visible and easy for new desktop users
  • Loading branch information
joelkanyi committed Jun 19, 2024
2 parents 796b3c0 + c6c7cab commit 8a57be7
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import cafe.adriel.voyager.navigator.currentOrThrow
import cafe.adriel.voyager.navigator.tab.LocalTabNavigator
import com.joelkanyi.focusbloom.core.domain.model.SessionType
import com.joelkanyi.focusbloom.core.domain.model.Task
import com.joelkanyi.focusbloom.core.presentation.component.BloomButton
import com.joelkanyi.focusbloom.core.presentation.component.BloomTab
import com.joelkanyi.focusbloom.core.presentation.component.TaskCard
import com.joelkanyi.focusbloom.core.presentation.component.TaskProgress
Expand Down Expand Up @@ -197,6 +198,9 @@ fun HomeScreen(
else -> {}
}
},
onClickAddTask = {
tabNavigator.current = BloomTab.AddTaskTab()
}
)
}

Expand All @@ -217,6 +221,7 @@ private fun HomeScreenContent(
shortBreakColor: Long?,
longBreakColor: Long?,
onClickActiveTaskOptions: (task: Task) -> Unit,
onClickAddTask: () -> Unit,
) {
Scaffold { paddingValues ->
Box(
Expand Down Expand Up @@ -439,6 +444,21 @@ private fun HomeScreenContent(
),
textAlign = TextAlign.Center,
)

Spacer(modifier = Modifier.height(24.dp))
if (tasks.isEmpty()) {
BloomButton(
onClick = onClickAddTask,
) {
Text(
modifier = Modifier.padding(horizontal = 24.dp),
text = "Add Your First Task",
style = MaterialTheme.typography.labelMedium.copy(
fontWeight = FontWeight.Bold,
),
)
}
}
}
}
}
Expand Down

0 comments on commit 8a57be7

Please sign in to comment.