Closed ebma closed 9 months ago
Name | Link |
---|---|
Latest commit | e8a5ded774ebb48a08c7625242a052561e3e3e00 |
Latest deploy log | https://app.netlify.com/sites/pendulum-pay/deploys/65831919a1be010009d0ea4e |
Deploy Preview | https://deploy-preview-13--pendulum-pay.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
yarn.lock
changesStatus | Count |
---|---|
40 | |
27 | |
82 | |
642 |
Why are pages and components in this nested structure inside as index.tsx files? E.g., instead of (the more obvious?) pages/Landing.tsx it is pages/landing/index.tsx. I personally find the latter harder to work with because all open pages in my tabs are just called index.tsx and navigation is harder.
The idea here is to group all files that relate to one component or page into one directory. For example in the component case, imagine that we define the styles for that component in a stylesheet just for that component or we have a test, then they could be grouped with Button
> index.tsx
, index.test.tsx
, style.css
. And by calling the main file of that component index.tsx
it's easier to import because you don't have to do import Button from 'Button/Button'
but can just to import Button from 'Button'
. See also for example the components in MUI here.
But I see your point and I don't mind too much. I just read about it in a book about React and it made sense to me so I started using it like this. It's probably not super important for us because we don't define the styles in an extra .css file and I doubt we'll write a lot of tests for the components.
This is also something personal, but I like to keep the number of dependencies to a minimum, particularly for a project that deals with money.
Right, I'll change that.
Thanks for that reasoning, almost thought so, but then thought that our components will most likely be self contained and the css will be in the ts file. So yeah, it might just boil down to whether we use tests or not. I'm fine either way then.
I removed the unnecessary dependencies now but left the index.tsx
structure for components and pages as is.
This removes a lot of the portal-related functions and components while keeping the basic structure alive. I would not recommend looking at the changes displayed for this PR but rather having a look at the branch directly.
Notes
assets
folderAbout preact
When starting the development on the portal, our freelance frontend developer decided to set it up for use with preact.js. It apparently has some performance benefits over 'regular' react and it's very simple to use because it exposes the same functions/hooks with the same interfaces. So all we have to do going forward is to import hooks from
preact/compat
instead ofreact
. But we can also remove it if you have strong opinions on this @TorstenStueber.Closes #5.