-
Notifications
You must be signed in to change notification settings - Fork 3
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
Weekly calendar past events #1
Weekly calendar past events #1
Conversation
@vipermark7 is attempting to deploy a commit to the jasonetorres' projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Thanks for putting this together @vipermark7 ! 🚀
Providing my thoughts 🙏 But I'll let Jason have the final say as it's his repo!
Excited to see this happening! 🙌
<p>Events brought to you by | ||
<a | ||
href="https://guild.host/?utm_source=referral&utm_medium=chat&utm_campaign=general_link" | ||
target="_blank" rel="noopener noreferrer" | ||
className="text-blue-600 hover:underline" | ||
> | ||
Guild.host | ||
</a> | ||
</p> |
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.
@vipermark7 I'm not sure if your editor is re-formatting things like this? But may be good to disable that if it is
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.
yeah thats making my eye twitch lol
try { | ||
setLoading(true); | ||
|
||
while (hasPreviousPage) { |
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.
This approach appears to eagerly load all events that exist across all of Torc
I understand that's more-or-less what it was doing before, so maybe this is fine as a first step? I'll let Jason weigh in
However as a follow-up, I'd like to see it more incrementally loading each page as needed. Essentially, if the final item that's available is less than the start/end of the week that's being displayed, then load in the next page
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.
approved PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Yep, I was trying to get the cursors for previous events to work. It was a
bit difficult to see if the current code will load past events lazily, as
the Torc data appearing on the Weekly Calendar only went back until the 10th
…On Wed, Feb 12, 2025, 3:46 PM Taz Singh ***@***.***> wrote:
***@***.**** commented on this pull request.
Thanks for putting this together @vipermark7
<https://github.com/vipermark7> ! 🚀
Providing my thoughts 🙏 But I'll let Jason have the final say as it's his
repo!
Excited to see this happening! 🙌
------------------------------
In src/components/WeeklyCalendar.tsx
<#1 (comment)>:
> + <p>Events brought to you by
+ <a
+ href="https://guild.host/?utm_source=referral&utm_medium=chat&utm_campaign=general_link"
+ target="_blank" rel="noopener noreferrer"
+ className="text-blue-600 hover:underline"
+ >
+ Guild.host
+ </a>
+ </p>
@vipermark7 <https://github.com/vipermark7> I'm not sure if your editor
is re-formatting things like this? But may be good to disable that if it is
------------------------------
In src/hooks/useEvents.ts
<#1 (comment)>:
> + const [events, setEvents] = useState<Record<string, Event[]>>({});
+ const [loading, setLoading] = useState(false);
+ const [error, setError] = useState<string | null>(null);
+
+ useEffect(() => {
+ const fetchAllEvents = async () => {
+ const allFormattedEvents: Record<string, Event[]> = {};
+ let hasNextPage: boolean = true;
+ let hasPreviousPage: boolean = true;
+ let startCursor: string | null = null;
+ let endCursor: string | null = null;
+
+ try {
+ setLoading(true);
+
+ while (hasPreviousPage) {
This approach appears to eagerly load all events that exist across all of
Torc
I understand that's more-or-less what it was doing before, so maybe this
is fine as a first step? I'll let Jason weigh in
However as a follow-up, I'd like to see it more incrementally loading each
page as needed. Essentially, if the final item that's available is less
than the start/end of the week that's being displayed, then load in the
next page
—
Reply to this email directly, view it on GitHub
<#1 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACKMZRG5NTWCNJXL4PD754T2POXKFAVCNFSM6AAAAABXAQGX2KVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMJTGE2DONJTGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
<p>Events brought to you by | ||
<a | ||
href="https://guild.host/?utm_source=referral&utm_medium=chat&utm_campaign=general_link" | ||
target="_blank" rel="noopener noreferrer" | ||
className="text-blue-600 hover:underline" | ||
> | ||
Guild.host | ||
</a> | ||
</p> |
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.
yeah thats making my eye twitch lol
Screenshot of the Torc weekly calendar picking up past events. Clicking the back button
<
showed no events, because none were coming from the Guild API