2.0.2 • Published 2 years ago

@salvagr/react-instagram-data v2.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

React Instagram Data

Easy way to get a beautiful media grid from any business instagram account.

IMPORTANT! If you wanna use this package, you need to have a App in developers.facebook.com with a instagram graph api connected.

Installation

npm install @salvagr/react-instagram-data
# OR
yarn add @salvagr/react-instagram-data

I use the env file to setup the functionality. Please follow the next step depending on your project. Right now, the vars are public for client, I'm working for making these private.

NEXT.JS

# .env file
NEXT_PUBLIC_IG_ACCESS_TOKEN=...
NEXT_PUBLIC_IG_BUSINESS_ID=...

REACT APP

# .env file
REACT_APP_IG_ACCESS_TOKEN=...
REACT_APP_IG_BUSINESS_ID=...

Example usage

import { Instagram } from '@salvagr/react-instagram-data';

const App = () => {
  return (
    <div>
      <Instagram
        username="instagram"
      />
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById('root'));

Change the style

You can change the style and add your own. Each component has a name assigned (next table), you can use the React style to change the css of the component.

KeyDefault
profileContainerbackgroundColor: #F5F5F5display: 'flex'alignItems: 'center'maxWidth: '300px'justifyContent: 'space-evenly'padding: '10px'borderRadius: '20px'fontFamily: '#Poppins'`
profileImageborderRadius: '100vh'maxWidth: '80px'
profileDataContainerh2 : {margin: '0.5rem 0',fontSize: '21px'}
profileFollowsContainerp : {margin: '0.4rem 0',fontSize: '14px'}
mediaContainerbackgroundColor: #F5F5F5display: 'flex'gap: '1rem'justifyContent: 'center'alignItems: 'flex-start'marginItems: '1rem'padding: '1rem'borderRadius: '20px'flexWrap: 'wrap'
mediaBoxbackgroundColor: #fffwidth: '300px'borderRadius: '20px'display: 'flex'flexDirection: 'column'flexWrap: 'wrap'position: 'relative'zIndex: '1'a: {textDecoration: 'none',color: '#121212'}image: {maxWidth: '100%',borderRadius: '20px',display: 'block'}
overlaybackgroundColor: rgba(0,0,0,0.0)transform: 'scale(0)'transition: 'background .25s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0s linear .25s'position: 'absolute'width: '100%'height: '100%'top: 0borderRadius: '20px'fontFamily: 'Poppins'content: {color: 'white',position: 'absolute',top: '50%',left: '50%',transform: 'translate(-50%, -50%),infoRows: {display: 'flex',alignItems: 'center',gap: '0.3rem'}}
import { Instagram } from '@salvagr/react-instagram-data';

const App = () => {
  return (
    <div>
      <Instagram
        username="instagram"
        style={{
          profileContainer: {
            backgroundColor: '#FFAAAA'
          }
        }}
      />
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById('root'));

Limit

You can limit the post results.

<Instagram
  limit={8}
  username="instagram"
/>
2.0.2

2 years ago

1.0.2

3 years ago

1.1.0

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

2.0.1

3 years ago

1.0.24

3 years ago

2.0.0

3 years ago

1.0.23

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.1.0

3 years ago