Git Product home page Git Product logo

performant-search's Introduction

Search Component Challenge

This project was completed on the 7th August 2021.

Available Scripts

To start the project, run

npm install to install dependencies.
npm run start to view in development mode.
npm run test to launch the test runner.
npm run build to build the package.

Built with

  • create-react-app
  • TypeScript
  • Jest & react-testing-library

How to use the component

  1. Click the input box to see the dropdown.
  2. Hover over the dropdown items to scroll and see list of countries.
  3. Type an input string to filter the dropdown.
  4. Click an item to select the country.

Approach

1. Folder Structure

.
├── public
├── src
│ ├── components
│ │ └── Search
│ ├── App.css
│ ├── App.tsx
│ ├── index.css
│ └── index.tsx
├── .gitignore
├── package.json
└── README.md

Each route and component has the following files:

  • index.tsx (where the main component is exported)
  • {component}.css (where all the styles are included)
  • {component}.test.tsx (where all the tests are written specifically for that component)

Things I didn't get to implement in time

  • Not displaying the flag on the input field

Improvements to make

  1. State to be taken out of App.tsx and put into redux or useContext
  2. Dropdown to not be "display: none" will have the conditional logic to only render when the dropdown is requested
  3. Use of Sass or Styled components for styling

performant-search's People

Contributors

lee-jacqueline 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.