Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 1234 | Rev 1512 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1234 Rev 1235
Línea 1... Línea 1...
1
import React, { useEffect } from 'react'
1
import React from 'react'
2
import { openShareModal } from '../../../../redux/share-modal/shareModal.actions'
2
import { openShareModal } from '../../../../redux/share-modal/shareModal.actions'
3
import { shareModalTypes } from '../../../../redux/share-modal/shareModal.types'
3
import { shareModalTypes } from '../../../../redux/share-modal/shareModal.types'
4
import { useDispatch, useSelector } from 'react-redux'
4
import { useDispatch, useSelector } from 'react-redux'
5
import styled from 'styled-components'
5
import styled from 'styled-components'
Línea 13... Línea 13...
13
 
13
 
14
import Input from '../../../UI/Input'
14
import Input from '../../../UI/Input'
Línea 15... Línea 15...
15
import ShareOption from './ShareOption'
15
import ShareOption from './ShareOption'
16
 
-
 
17
import styles from './ShareComponent.module.scss'
-
 
Línea 18... Línea 16...
18
import InputForm from 'components/UI/form/InputForm'
16
 
19
import { useForm } from 'react-hook-form'
17
import styles from './ShareComponent.module.scss'
20
 
18
 
21
const StyledInput = styled(Input)`
19
const StyledInput = styled(Input)`
Línea 34... Línea 32...
34
 
32
 
35
const ShareComponent = ({ feedType, postUrl = '', image = '' }) => {
33
const ShareComponent = ({ feedType, postUrl = '', image = '' }) => {
36
  const labels = useSelector(({ intl }) => intl.labels)
34
  const labels = useSelector(({ intl }) => intl.labels)
Línea 37... Línea -...
37
  const dispatch = useDispatch()
-
 
38
 
-
 
39
  const { control, watch } = useForm()
35
  const dispatch = useDispatch()
40
 
36
 
41
  const onClickHandler = (postType) => {
37
  const onClickHandler = (postType) => {
Línea 42... Línea -...
42
    dispatch(openShareModal(postUrl, postType, feedType))
-
 
43
  }
-
 
44
 
-
 
45
  useEffect(() => {
-
 
46
    const subscription = watch((value, { name, type }) =>
-
 
47
      console.log(value, name, type)
-
 
48
    )
-
 
49
 
-
 
50
    return () => subscription.unsubscribe()
38
    dispatch(openShareModal(postUrl, postType, feedType))
51
  }, [watch])
39
  }
52
 
40
 
53
  return (
41
  return (
Línea 60... Línea 48...
60
          readOnly
48
          readOnly
61
          icon={CreateIcon}
49
          icon={CreateIcon}
62
          placeholder={labels.what_are_you_thinking}
50
          placeholder={labels.what_are_you_thinking}
63
          onClick={() => onClickHandler(shareModalTypes.POST)}
51
          onClick={() => onClickHandler(shareModalTypes.POST)}
64
        />
52
        />
65
 
-
 
66
        <InputForm control={control} name='text' />
-
 
67
      </div>
53
      </div>
Línea 68... Línea 54...
68
 
54
 
69
      <div className={styles.share__options}>
55
      <div className={styles.share__options}>
70
        <ShareOption
56
        <ShareOption