-
Notifications
You must be signed in to change notification settings - Fork 0
glimpse-GM-Timeline5 #10
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
base: main
Are you sure you want to change the base?
Changes from all commits
6232e91
9804dd7
8184b1f
d51d083
783e5ed
3b8dda1
00186c3
d71489e
29789fc
8517e01
44364d0
50c8197
16ed3b1
6db6f0a
4c02717
74d0eca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,4 +39,4 @@ yarn-error.* | |
| # The following patterns were generated by expo-cli | ||
|
|
||
| expo-env.d.ts | ||
| # @end expo-cli | ||
| # @end expo-cli | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| // *Imports | ||
| import React from "react"; | ||
| import { Text, View } from "react-native"; | ||
|
|
||
| // *Constants | ||
| const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; | ||
| const today = new Date(); | ||
| const todayIndex = today.getDay(); | ||
|
|
||
| // *Start of the Timeline Function | ||
| export default function Timeline() { | ||
| const firstDayOfWeek = new Date(today); | ||
| firstDayOfWeek.setDate(today.getDate() - todayIndex); | ||
|
|
||
| return ( | ||
| <View className="flex-row space-x-3 items-center"> | ||
| {days.map((day, index) => { | ||
| const dayDate = new Date(firstDayOfWeek); | ||
| dayDate.setDate(firstDayOfWeek.getDate() + index); | ||
| const dateNumber = dayDate.getDate(); | ||
|
|
||
| return ( | ||
| <View key={index} className="flex-col items-center"> | ||
| <Text className="mb-2 font-semibold">{day}</Text> | ||
| <View | ||
| className={`w-10 h-10 rounded-full shadow-md shadow-gray-200 flex items-center justify-center ${ | ||
| todayIndex === index ? "border border-[#5731D6]" : "bg-white" | ||
| }`} | ||
| > | ||
| <Text | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found something called MaskedView, which would allow us to have gradient text. For the border, you could probably just add a linear gradient circle behind the selected circle. Here's some example code for the timeline with just the text change. Not sure if you still want to pursue gradient colored text, but it might be worth looking into if we ever have gradient text components/UI in the future.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just noticed that there does seem to be some sort of thing where the circle becomes transparent for the selected day in the little code snippet I pasted, but hopefully when actually used, we could try to fix that |
||
| className={`text-center ${ | ||
| todayIndex === index ? "text-[#5731D6]" : "text-black" | ||
| }`} | ||
| > | ||
| {dateNumber} | ||
| </Text> | ||
| </View> | ||
| </View> | ||
| ); | ||
| })} | ||
| </View> | ||
| ); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is included in the component feature, but thinking ahead, we could potentially have a selected state and onSelectedStateChange being passed with the default state being that which corresponds to the current date, but when the user clicks into a previous bubble, they would select a new day which would allow them to view the previous feeds.