GithubHelp home page GithubHelp logo

frontend-assignment's Introduction

Frontend Developer Assignment

desktop

Get Started

Installation

  1. Clone the repository
git clone https://github.com/nour-aldin/frontend-assignment
  1. Navigate to repository directory
$ cd frontend-assignment
  1. Install dependencies
$ npm install

Running

  1. Compile and hot-reload for development
$ npm run dev
  1. Compile, prefix and minify for production
$ npm run build

๐Ÿ’ป Built With

  • React
  • CSS
  • tailwindcss

Design Choices

  • Overlay for background image design

  • Most of elements organized using flexbox

  • Component-based approach: The code is structured using React components. The NavBar component encapsulates the navigation bar functionality and rendering.

  • State management: The code uses the useState hook to manage state within the NavBar component. It maintains the user state to represent the user data and the isMenuOpen state to track the state of the menu toggle.

  • Data fetching with useEffect: The useEffect hook is utilized to fetch data from an API endpoint. It triggers the data retrieval when the component mounts by passing an empty dependency array ([]) as the second argument. This ensures that the effect runs only once.

  • Conditional rendering: The code utilizes conditional rendering to handle the loading state. If the user state is null (indicating data is still being fetched), it renders a loading message. Once the user state is populated, the navigation bar is rendered with the user's data.

  • Dynamic data rendering: The code dynamically renders the navigation links using an array of strings (links). This approach allows for flexibility in adding or modifying the navigation links without modifying the code structure.

  • Styling: The code uses Tailwind CSS classes for styling the navigation bar. The classes are applied to the HTML elements to achieve the desired visual presentation.

frontend-assignment's People

Contributors

nour-aldin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.