Skip to content
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

Reuse google calendar react component #176

Closed
wants to merge 11 commits into from

Conversation

goanpeca
Copy link
Contributor

@goanpeca goanpeca commented Feb 15, 2024

Description

This PR is changing the iframe google calendar by a styled react component from
https://github.com/ericz1803/react-google-calendar

To better suit the theme.

Before

Screenshot 2024-02-15 at 5 08 22 PM

After

Screenshot 2024-02-15 at 5 03 16 PM

Demo

calendar

See

ericz1803/react-google-calendar#68

Copy link

netlify bot commented Feb 15, 2024

Deploy Preview for conda-dot-org ready!

Name Link
🔨 Latest commit 066603f
🔍 Latest deploy log https://app.netlify.com/sites/conda-dot-org/deploys/65def550ad4c8f00083eb243
😎 Deploy Preview https://deploy-preview-176--conda-dot-org.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@goanpeca
Copy link
Contributor Author

goanpeca commented Feb 15, 2024

Ok so it seems that we need a newer version of react, but that might not work with the current version of docusaurus (2.3.1) used in this project. Is there a reason for using 2.3.1 still, latest version is 3.1.1 it seems

After updating to 3.1.1 the following errors still remain

[WARNING] {"moduleIdentifier":"/Users/gpenacastellanos/Desktop/develop/conda-forge/conda-dot-org/node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js","moduleName":"./node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js","loc":"2699:33-51","message":"Module not found: Error: Can't resolve './locale' in '/Users/gpenacastellanos/Desktop/develop/conda-forge/conda-dot-org/node_modules/@ericz1803/react-google-calendar/dist'","compilerPath":"client"}
[WARNING] {"moduleIdentifier":"/Users/gpenacastellanos/Desktop/develop/conda-forge/conda-dot-org/node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js","moduleName":"./node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js","loc":"2699:33-51","message":"Module not found: Error: Can't resolve './locale' in '/Users/gpenacastellanos/Desktop/develop/conda-forge/conda-dot-org/node_modules/@ericz1803/react-google-calendar/dist'","compilerPath":"server"}

@jaimergp
Copy link
Contributor

@goanpeca: I think this fixed the rendering, but we still have that moment.js locale problem.

@goanpeca
Copy link
Contributor Author

@jaimergp I fixed the code to get the API key, but locally and on netlify I now get the following error:

Error: Docusaurus server-side rendering could not render static page with path /community/calendar because of error: Cannot read properties of null (reading "registered")

I am not sure if it is related to the warnings or if it is something different from the calendar react component :-|

@goanpeca goanpeca changed the title Add google calendar react component Reuse google calendar react component Feb 27, 2024
@goanpeca
Copy link
Contributor Author

goanpeca commented Feb 27, 2024

It is working now as expected 🚀

Got this reply from the docusaurus folks:

Your lib does not support server-side rendering, so you need to tell Docusaurus to not attempt to server-render it.

This means bypassing static html generation of that particular calendar component, and displaying some kind of loading placeholder instead, because that component can't be run inside Node.js.

Read docs:
docusaurus.io/docs/docusaurus-core#browseronly
docusaurus.io/docs/advanced/ssg#browseronly

If you want to have a good experience without spinners and layout shifts, it's preferable to use libraries that support SSR/SSG (running in Node.js)

@goanpeca goanpeca marked this pull request as ready for review February 27, 2024 22:30
@jaimergp
Copy link
Contributor

Awesome, I fixed one issue with the overflow-y of the events (I got a tiny scrollbar with each event item).

Unfortunately, I think the library has a bug: conda-forge events show up at 7pm, while conda-community ones show up at 6pm. Yet both happen at the same time every other Wednesday. I think one of the events is set to UTC as the base timezone, while the other is tied to a given timezone with daylight savings. The iframe does show the correct times, but this React component does not...

@jaimergp
Copy link
Contributor

Maybe it'd be fixed if we ever get rid of the locale warning?

@goanpeca
Copy link
Contributor Author

Maybe it'd be fixed if we ever get rid of the locale warning?

Maybe 🤷🏼

Could you locally change this line inside the following file and check if affects anything locally for you (calendar correctly shows the 2 events at the same time)

../conda-dot-org/node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js
Line 2699
A = SM._abbr, z = require, z("moment/locale/" + b), Eb(A);

@jaimergp
Copy link
Contributor

Nop, the warning is gone but the 6/7pm issue persists:

image

@goanpeca
Copy link
Contributor Author

Hmmm. What time zone are you in? I changed mi computer to Berlin, Germany and now events appear as 5:00 pm both 🤔

@jaimergp
Copy link
Contributor

image

🤷 This is Chrome Version 117.0.5938.149 (Official Build) (arm64)

@jezdez
Copy link
Member

jezdez commented Jul 31, 2024

I wonder what else is needed to move this ahead?

@jaimergp
Copy link
Contributor

We couldn't fix that 6pm/7pm locale issue so we are currently blocked until that gets fixed.

Copy link

netlify bot commented Aug 21, 2024

Deploy Preview for conda-dot-org ready!

Name Link
🔨 Latest commit 85619d7
🔍 Latest deploy log https://app.netlify.com/sites/conda-dot-org/deploys/66c5ad09f9f74a0008b28a84
😎 Deploy Preview https://deploy-preview-176--conda-dot-org.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jaimergp
Copy link
Contributor

Superseded by #221

@jaimergp jaimergp closed this Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants