[ABANDONDED] Set of "apps" for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
593 B

5 years ago
  1. import React, { FC, useState, useEffect } from 'react'
  2. import classNames from 'classnames'
  3. import { ClassDictionary, GiphyGif } from '../../../types'
  4. interface Props {
  5. gif: GiphyGif
  6. selected: boolean
  7. onSelect: (id: string) => void
  8. }
  9. const Gif: FC<Props> = ({ gif, selected, onSelect }) => {
  10. const classes: ClassDictionary = {
  11. gif: true,
  12. selected,
  13. }
  14. return (
  15. <div className={classNames(classes)} onClick={() => onSelect(gif.id)}>
  16. <img src={gif.images.fixed_height.url} alt={gif.title} />
  17. </div>
  18. )
  19. }
  20. export default Gif