Skip to content

llhyuan/Space-tourism-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Space tourism website solution

This is a solution to the Space tourism website challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Note: Delete this note and update the table of contents based on what sections you keep.

Overview

The challenge

Users should be able to:

  • View the optimal layout for each of the website's pages depending on their device's screen size
  • See hover states for all interactive elements on the page
  • View each page and be able to toggle between the tabs to see new information

Screenshot

mobile-view1 mobile-view2 tablet-view1 tablet-view2 tablet-view3 desktop-view1 desktop-view2 desktop-view3

Links

My process

Built with

  • React hooks (useState, useContext, useEffect)
  • SCSS custom properties
  • Flexbox
  • Mobile-first workflow
  • React - JS library
  • React Router - Client side rendering library
  • Fontawesome - For icons

What I learned

1, Using React Router for client side routing.

  • Different pages are built as React components and loaded accordingly as the user navigates through the website.
  • Url parameters are used to help load different data on the same page.
  • Though data is provided locally in this project, loader and useLoaderData are used, faking a structure of fetching and filtering data from a database.

2, Using createContext, useContext and useEffect are used to coordinate among components.

  • A state is used at the root of the web app to keep track of the current page.
  • This information is then used to keep the navbar's active state in sync.
  • However, when user navigates back along the history stack, the navbar active status would not update.
    • context is used share navbar active status and the setter function to all other page components.
    • useEffect is used to call that setter function to update the navbar's active status, to be in sync with the current page.

3, Utility classes are used to make styling different titles across pages easiler.

  • At the end of this project, I'm starting to see the point of tailwind css. Combine it with user defined utility classes might keep the html a bit tidier, while riding high on that TAILWIND.

Useful resources

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published