GithubHelp home page GithubHelp logo

0x4bd0 / hackerrank-react-skill-certification-test-2 Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 184 KB

solution

Shell 2.65% HTML 13.88% CSS 2.95% JavaScript 80.52%
hackerrank-solutions hackerrank hackerrank-challenges reactjs react

hackerrank-react-skill-certification-test-2's Introduction

React: Slideshow App

Environment

  • React Version: 16.13.1
  • Node Version: ^12.18.3
  • Default Port: 8000

Project Specifications

Create a basic slideshow application, as shown below. Application requirements are given below, and the finished application must pass all of the unit tests.

Gif

Your task is to complete the implementation of src/components/Slides.js according to the following requirements:

  • The Slides component takes an array of slides as a prop. Each element of this array denotes a single slide and is an object with 2 properties: string title and string text.
  • On application launch, the first slide must be rendered.
  • Clicking on the "Next" button shows the next slide. This button is disabled when the current slide is the last one.
  • Clicking on the "Prev" button shows the previous slide. This button is disabled when the current slide is the first one.
  • Clicking on the "Restart" button returns to the first slide. This button is disabled when the current slide is the first one.
  • You can assume that the passed slides array contains at least one slide.

Initially, the file is filled with boilerplate code. Note the following:

  • The "Restart" button must have data-testid="button-restart".
  • The "Prev" button must have data-testid="button-prev".
  • The "Next" button must have data-testid="button-next".
  • Each slide's title must be rendered as an <h1> element with data-testid="title".
  • Each slide's text must be rendered as a <p> element with data-testid="text".

Please note that the component has the above data-testid attributes for test cases and certain classes and ids for rendering purposes. It is advised not to change them.

Read-Only Files

  • src/App.test.js

Commands

  • run:
bash bin/env_setup && . $HOME/.nvm/nvm.sh && npm start
  • install:
bash bin/env_setup && . $HOME/.nvm/nvm.sh && npm install
  • test:
bash bin/env_setup && . $HOME/.nvm/nvm.sh && npm test

hackerrank-react-skill-certification-test-2's People

Contributors

0x4bd0 avatar

Stargazers

 avatar

Watchers

 avatar  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.