-
Notifications
You must be signed in to change notification settings - Fork 7
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
Frontend refactorings & dashboard features #53
Conversation
✅ Deploy Preview for metaforecast ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
}) => { | ||
// I experimented with justify-evenly, justify-around, etc., here: https://tailwindcss.com/docs/justify-content | ||
// I came to the conclusion that as long as the description isn't justified too, aligning the footer symmetrically doesn't make sense | ||
// because the contrast is jarring. |
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 how I feel about this; for me, non-symmetric footers feel really jarring. But I'll defer to you.
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.
Uh, that's your comment that I should've removed :)
I haven't changed anything re: footers alignment.
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.
Oof, lol
docs/coding-style.md
Outdated
# React | ||
|
||
- create one file per one component (tiny helper components in the same file are fine) | ||
- if |
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.
if?
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.
Already fixed in 8d6cf48
# General notes | ||
|
||
- use `const` instead of `let` whenever possible | ||
- set up [prettier](https://prettier.io/) to format code on save |
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 the documenting!
This looks good. Could you also create a dashboardEmbed with the same schema (dashboardEmbed/view/[id]), to replace secretDashboard, but without deleting the secretDashboard page yet? |
Maybe I could just add a redirect to it and keep Btw, where is |
dashboard/embed/[id] sounds a bit better.
Sounds good, though maybe not forever.
Here: https://globalguessing.com/russia-ukraine-forecasts/, that I know of |
Oh, I mixed it up with /secretEmbed. /secretDashboard is fine. |
/secretEmbed is used by the twitter bot. Is this PR ready to be merged? |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/quantified-uncertainty/metaforecast/5ZTfKLAW8aiqZH82jxMy1jssYKCC |
Yes! ✔️ Also, I added |
I'm getting some errors in Vercel related to this commit @berekuk |
Nice |
That's #15 again (due to me pushing longer versions of infer/gjopen cookies there). Fixed. |
Ok, I got a bit carried away here (instead of working on graphql, going to start on that soon), but these are the cleanups I wanted to do eventually.
What's included:
docs/coding-style.md
explaining what I consider to be best practice.React.FC<Props>
DisplayForecast
component, split footer in a separate file (and should've split more stuff), removed some unused code, etc.let
s withconst
s wherever I've seen them :) (two more letters, but it's better for typing and clearer in intent)DisplayForecast
,/tools
and/dashboards
:Card
,Button
andLastUpdated
showTimeStamp
and screen size... but I think I checked most of it, e.g. how question cards look on/secretEmbed
)mt-N mb-M
I tried to replace it withspace-y-N
in the parent component, and some sub-components shifted by a few pixels due to this/dashboards/view/[id]
, with redirects from the old/dashboards?dashboardId=[id]
(using middleware, seesrc/pages/_middleware.ts
)initialVariable
and useEffects, I think trying to handle it the old way is too much of an anti-pattern, tbh)