Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to share multiple images on social media in react-share #535

Open
Ganeshguru5 opened this issue Apr 23, 2024 · 0 comments
Open

How to share multiple images on social media in react-share #535

Ganeshguru5 opened this issue Apr 23, 2024 · 0 comments

Comments

@Ganeshguru5
Copy link

I am using react-share package for sharing images from my app to social media. I have array of images in the data.media how do i share the multiple images. alos i can't add title. only i can add hashtags

import React, { useEffect } from 'react'
import {
  FacebookIcon, FacebookShareButton, WhatsappIcon,
  WhatsappShareButton,
} from 'react-share'
import { withTheme } from '../../Theme/ThemeProvider'
import CustomModal from '../../UI/CustomModal'
import CustomText from '../../UI/CustomText'

function ShareModal(props) {
  const { toggleModal, visible, data } = props
  useEffect(() => {
    console.log(data, 'data on lap')
  }, [data])
  return (
    <CustomModal
      visible={visible}
      onDismiss={() => toggleModal('showShareModal')}
    >
      <CustomText size="medium" weight="bold">Share to</CustomText>
      <FacebookShareButton
        quote={data.message}
        url={data.mediaDire ? data.mediaDire[0].media : ''}
      >
        <FacebookIcon round />
      </FacebookShareButton>
      <WhatsappShareButton
        quote={data.message}
        url={data.mediaDire ? data.mediaDire[0].media : ''}
      >
        <WhatsappIcon round />
      </WhatsappShareButton>
    </CustomModal>
  )
}

const stylesheet = {
}

export default withTheme(stylesheet)(ShareModal)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant