-
Notifications
You must be signed in to change notification settings - Fork 2
feat(review): lay out the monthly letter as theme, stats and suggestion #548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AlexisEvan
wants to merge
4
commits into
main
Choose a base branch
from
letter-layout
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8fafc4f
feat(review): lay out the monthly letter as theme, stats and suggestion
AlexisEvan aaf7042
Merge branch 'main' into letter-layout
AlexisEvan a5fab3f
Merge branch 'main' into letter-layout
AlexisEvan 0c044e3
fix(review): address letter layout review feedback
AlexisEvan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
22 changes: 22 additions & 0 deletions
22
blotztask-mobile/src/feature/review/components/letter-next-step.tsx
This file contains hidden or 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,22 @@ | ||
| import { Text, View } from "react-native"; | ||
| import { useTranslation } from "react-i18next"; | ||
|
|
||
| type Props = { | ||
| suggestion: string; | ||
| }; | ||
|
|
||
| export function LetterNextStep({ suggestion }: Props) { | ||
| const { t } = useTranslation("settings"); | ||
|
|
||
| return ( | ||
| <View className="mb-8"> | ||
| <Text className="text-[15px] font-balooBold text-secondary mb-1"> | ||
| {t("monthlyReview.nextMonthTitle")} | ||
| </Text> | ||
|
|
||
| <Text className="text-[15px] font-baloo text-secondary" style={{ lineHeight: 26 }}> | ||
| {suggestion} | ||
| </Text> | ||
| </View> | ||
| ); | ||
| } |
54 changes: 54 additions & 0 deletions
54
blotztask-mobile/src/feature/review/components/letter-stats.tsx
This file contains hidden or 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,54 @@ | ||
| import { Text, View } from "react-native"; | ||
| import MaterialCommunityIcons from "@react-native-vector-icons/material-design-icons/static"; | ||
| import { useTranslation } from "react-i18next"; | ||
|
|
||
| type Props = { | ||
| tasksCompleted: number | null; | ||
| }; | ||
|
|
||
| type Stat = { | ||
| key: string; | ||
| value: number; | ||
| label: string; | ||
| icon: "check-circle"; | ||
| color: string; | ||
| }; | ||
|
|
||
| // The design shows three stats, but only tasksCompleted has a data source today — so the row | ||
| // renders whichever stats it was given rather than a fixed three. | ||
| export function LetterStats({ tasksCompleted }: Props) { | ||
| const { t } = useTranslation("settings"); | ||
|
|
||
| const stats: Stat[] = []; | ||
|
|
||
| // Hide a zero count — the letter is gentle about unfinished tasks, and a big green "0" reads harsh. | ||
| if (tasksCompleted !== null && tasksCompleted > 0) { | ||
| stats.push({ | ||
| key: "tasksCompleted", | ||
| value: tasksCompleted, | ||
| label: t("monthlyReview.tasksCompleted"), | ||
| icon: "check-circle", | ||
| color: "#84CC16", | ||
| }); | ||
| } | ||
|
|
||
| if (stats.length === 0) return null; | ||
|
|
||
| return ( | ||
| <View className="flex-row mb-5 gap-x-9"> | ||
| {stats.map((stat) => ( | ||
| <View key={stat.key}> | ||
| <View className="flex-row items-center"> | ||
| <MaterialCommunityIcons name={stat.icon} size={18} color={stat.color} /> | ||
|
|
||
| <Text className="ml-1.5 text-xl font-balooBold" style={{ color: stat.color }}> | ||
| {stat.value} | ||
| </Text> | ||
| </View> | ||
|
|
||
| <Text className="mt-0.5 text-xs font-baloo text-secondary/50">{stat.label}</Text> | ||
| </View> | ||
| ))} | ||
| </View> | ||
| ); | ||
| } |
20 changes: 20 additions & 0 deletions
20
blotztask-mobile/src/feature/review/components/letter-theme.tsx
This file contains hidden or 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,20 @@ | ||
| import { Text, View } from "react-native"; | ||
| import { useTranslation } from "react-i18next"; | ||
|
|
||
| type Props = { | ||
| theme: string; | ||
| }; | ||
|
|
||
| export function LetterTheme({ theme }: Props) { | ||
| const { t } = useTranslation("settings"); | ||
|
|
||
| return ( | ||
| <View className="mb-5"> | ||
| <Text className="text-[10px] font-baloo text-secondary/50 uppercase tracking-[2px] mb-1.5"> | ||
| {t("monthlyReview.themeLabel")} | ||
| </Text> | ||
|
|
||
| <Text className="text-base font-balooBold text-secondary">{theme}</Text> | ||
| </View> | ||
| ); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.