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

feature(website): recipients selection page #563

Merged
merged 15 commits into from
Nov 28, 2023
Merged

Conversation

CluEleSsUK
Copy link
Contributor

@CluEleSsUK CluEleSsUK commented Sep 6, 2023

I've taken a first pass at the UI for the draw transparency page as per #562

I still need to actually pull the data from somewhere - I suspect it's possible to pull it from the repo itself as a file, as everything will be in the repo and we're using server rendering (though the component is actually 'use client' in order to use Disclosure from @headlessui).

Some outstanding thoughts

  • do I need to bump the version of shared somewhere to get the translations? I can't get them locally, but I see it pulls in a static version (rather than exploiting a local module)
  • do I need to do anything to pull in daisyUI? I saw it's in the ui module, but I couldn't access anything from it out-of-the-box in website. That might avoid the 'use client' declaration, and make it easier to pull the data.
  • the linter was happy with my changes, though I noted there is some consistency over using ' and " in different places; is there a consensus on what to use where?

@vercel
Copy link

vercel bot commented Sep 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
public ⬜️ Ignored (Inspect) Nov 28, 2023 0:32am

@CluEleSsUK
Copy link
Contributor Author

Also it's not that pretty because I'm a terrible designer ;p if anyone has suggestions, I'm all ears!

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

PR Preview Action v1.4.4
🚀 Deployed preview to https://socialincome-san.github.io/public/pr-preview/pr-563/
on branch gh-pages at 2023-11-27 17:03 UTC

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

Visit the preview URL for this PR (updated for commit 03ed026):

https://si-admin-staging--pr563-feature-draw-transpa-zf5tjm0f.web.app

(expires Tue, 05 Dec 2023 12:35:48 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: b7b0969384059dce6ea8fad1ee1d1737e54e6676

import { LoaderIcon } from 'react-hot-toast';

export default function Page(props: DefaultPageProps) {
const [translator, setTranslator] = useState<Translator>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a useTranslator hook for this :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But generally, I would argue that it's better to load the translations inside a server component and pass them to the client component (see login/page.tsx as an example). By doing that, the statically rendered pages will contain the text. Otherwise, the text will only show after the client components have been hydrated.

@@ -42,6 +44,7 @@ export default async function Navbar({ lang, country }: DefaultParams) {
],
},
{ title: transparency, href: transparencyHref },
{ title: selection, href: selectionHref },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should probably also show a dropdown for the transparency section. No need to do it in this PR though, I'll do it in another one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's okay, I've got it!

@mkue
Copy link
Contributor

mkue commented Sep 6, 2023

  • do I need to bump the version of shared somewhere to get the translations? I can't get them locally, but I see it pulls in a static version (rather than exploiting a local module)

In local development, the cache is oftentimes not updated if you update the translations. To see them, you need to stop the website, delete the .next/ folder and then start the website again. It's a bit annoying, only happens with client-side translations, though.


  • do I need to do anything to pull in daisyUI? I saw it's in the ui module, but I couldn't access anything from it out-of-the-box in website. That might avoid the 'use client' declaration, and make it easier to pull the data.

No, you should be able to just use the react-daisyui components by importing them directly from @socialincome/ui. See the navbar-client.tsx file, there you can see how I used the Menu and Dropdown components.
The problem with those components is though that some of them only work in client components because the dot notation, e.g. Chart.Body, doesn't work in server components. I hope a library update will fix this at some point.


the linter was happy with my changes, though I noted there is some consistency over using ' and " in different places; is there a consensus on what to use where?

I think single quotes are used everywhere except for TSX/JSX ("HTML" code of components) where double quotes are used. I didn't configure this specifically, it seems to be a prettier default (see .prettierignore for more details).

@CluEleSsUK CluEleSsUK force-pushed the feature/draw-transparency branch from ee21059 to b7861ae Compare November 27, 2023 14:28
@CluEleSsUK CluEleSsUK force-pushed the feature/draw-transparency branch from 939d80e to 6ced509 Compare November 27, 2023 14:35
@CluEleSsUK CluEleSsUK marked this pull request as ready for review November 27, 2023 14:35
Copy link
Contributor

@mkue mkue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks all good👌 I updated the components a little and added German translations

@mkue mkue merged commit 65ba188 into main Nov 28, 2023
21 checks passed
@mkue mkue deleted the feature/draw-transparency branch November 28, 2023 13:05
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.

[Website Feature]: Draws overview page
2 participants