Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 696 Rev 1233
Línea 1... Línea 1...
1
import React from 'react'
1
import React, { useEffect } 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 16... Línea 18...
16
 
18
import InputForm from 'components/UI/form/InputForm'
17
import styles from './ShareComponent.module.scss'
19
import { useForm } from 'react-hook-form'
18
 
20
 
19
const StyledInput = styled(Input)`
21
const StyledInput = styled(Input)`
Línea 32... Línea 34...
32
 
34
 
33
const ShareComponent = ({ feedType, postUrl = '', image = '' }) => {
35
const ShareComponent = ({ feedType, postUrl = '', image = '' }) => {
34
  const labels = useSelector(({ intl }) => intl.labels)
36
  const labels = useSelector(({ intl }) => intl.labels)
Línea -... Línea 37...
-
 
37
  const dispatch = useDispatch()
-
 
38
 
35
  const dispatch = useDispatch()
39
  const { control, formState } = useForm()
36
 
40
 
37
  const onClickHandler = (postType) => {
41
  const onClickHandler = (postType) => {
Línea -... Línea 42...
-
 
42
    dispatch(openShareModal(postUrl, postType, feedType))
-
 
43
  }
-
 
44
 
-
 
45
  useEffect(() => {
38
    dispatch(openShareModal(postUrl, postType, feedType))
46
    console.log(formState)
39
  }
47
  }, [formState])
40
 
48
 
41
  return (
49
  return (
Línea 48... Línea 56...
48
          readOnly
56
          readOnly
49
          icon={CreateIcon}
57
          icon={CreateIcon}
50
          placeholder={labels.what_are_you_thinking}
58
          placeholder={labels.what_are_you_thinking}
51
          onClick={() => onClickHandler(shareModalTypes.POST)}
59
          onClick={() => onClickHandler(shareModalTypes.POST)}
52
        />
60
        />
-
 
61
 
-
 
62
        <InputForm control={control} name='text' />
53
      </div>
63
      </div>
Línea 54... Línea 64...
54
 
64
 
55
      <div className={styles.share__options}>
65
      <div className={styles.share__options}>
56
        <ShareOption
66
        <ShareOption