1.1.3 • Published 5 years ago

react-juicer v1.1.3

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

react-juicer

A feed of social media image posts using React and Juicer API.

Usage

yarn add react-juicer
import ReactJuicer from 'react-juicer';

const JuicerFeed = () => (
  <ReactJuicer
    feedId="juicer-feed-id"
    imagesPer={30}
  />
);

Props

NameTypeDefaultDescription
feedIdString (required)Required Juicer ID - the feed the component reads
imagesPerNumber (required)Number of items to load every time API is called
initialLimitNumberNumber of items to display on first render
disableLoadMoreBooleanfalseOptionally remove disable load more button
disableOnScrollBooleanfalseOptionally disable loading more items on scroll
renderFailFunctionOptionally override component that displays when could not fetch feed
renderLoadingFunctionOptionally override component that displays when loading
themeObjectdefaultTheme (see below)Optionally a theme object to style feed

Theme

A theme object can be passed to modify the default theme below

const defaultTheme = {
  feedItem: {
    color: '#ffffff',
    backgroundColor: '#000000',
  },
  media: media,
  columns: {
    default: 2,
    medium: 4,
    large: 6,
  },
  button: {
    padding: '0.75rem 1.25rem',
    color: 'white',
    backgroundColor: 'black',
    backgroundColorHover: 'black',
    borderRadius: rem(4),
    margin: '2rem auto',
  },
  anchorButton: {
    padding: '0.75rem 1.25rem',
    color: 'white',
    backgroundColor: 'black',
    backgroundColorHover: 'black',
    borderRadius: rem(4),
    margin: '0',
  },
};

Media is derived from styled-media-query which generates the breakpoints to display the number of columns of the feed

const media = generateMedia({
  huge: '1440px',
  large: '1170px',
  medium: '768px',
  small: '450px',
});

Debugging & Examples

Build react-juicer

yarn && yarn run install-peers

yarn run build

Create a react server using react scripts to display example

yarn run examples
1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago