Developed with react library using basic concepts ,only media queries
Design comparison
Solution retrospective
which approach you guys used to show the header on pages ?? And how do you guys moved the pages content with position:absolute or giving margin or padding to main containers of the pages? How to do you guys managed to show the images in this project i mean what practices you guys kept in focus to use images in this project??
Community feedback
- @DavidMorgadePosted over 2 years ago
Hello man congrats on finishing the challenge! well done.
-
First as a personal advice, I did encounter the same problem as you have when I did this project, since you are changing the background image on each page render, it has like a little moment that is loading and flashes a white background color, you could do a little tweak and add to your body a darker background- color to avoid this flashy effect!
-
For the header you just create a Header component and render it on every page, in my case I used NextJS and you can just put it on the index or render it on every page as a Create react App.
-
For the images of the pages, you can render conditionally using the useState hook, attaching an event to each button that changes the state and show renders different images / text
Sorry that I can't help you because in your Github repository I can only see your README file, try uploading the full project!
Hope my feedback helped you!
0@Nauman123NasirPosted over 2 years ago@DavidMorgade I have uploaded the full project now , you can check it and your valuable suggestions will be appreciated.Thanks
1@Nauman123NasirPosted over 2 years ago@DavidMorgade and yes i used the header component in app.js one time and it showed the header on every page
1@DavidMorgadePosted over 2 years ago@Nauman123Nasir Good job man!, now let me give you another advice that really save my live when I started using react, try using one of this too:
CSS modules or Styled components.
With CSS modules (You can use them with SCSS too), you can generate a stylesheet for each component (like you have in your project) and it will generate a class with a random name, so this mean that you will never repeat a class name.
But really, you should try styled components, this is a CSS in JS technique, is much easier to pass styles as props in components, has a similar syntax to SCSS and it will make your projects much more clean!
Any of the two you choose will be a good option, right now you are using a modules approach but without using modules, try it for your next project!
Marked as helpful0 -
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord