1.0.0 • Published 5 years ago

react-flicker-photos v1.0.0

Weekly downloads
1
License
(MIT)
Repository
github
Last release
5 years ago

react-flicker-photos

React component for viewing photos list of Flicker user

NPM JavaScript Style Guide

Install

npm install --save react-flicker-photos

Usage

import React, { Component } from 'react'
import ReactFlickerPhotos from 'react-flicker-photos'

class Example extends Component {
  render () {
    return (
      <ReactFlickerPhotos 
        UserID={UserId}
        ClickCallback={ClickCallback}
        ImagesPerPage={ImagesPerPage} />
    )
  }
}

Required inputs

InputTypeDescription
UserIDStringFlicker user id
ClickCallbackFunctionA function to be called when photo is clicked
ImagesPerPageNumberNumber of images to be loaded at same time

Callback Function

The passed callback function is called when a photo is clicked. It got one argument, an object of two properties in the below table:

propertyTypeDescription
srcStringPhoto original size source url
titleStringPhoto title

Todo

  • Handling Errors
  • Increase unit testing coverage
  • Get the API key as an input
  • Improve infinite scrolling behavior
  • Improve UI

License

(MIT) © AbdallahZac