Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1979 Rev 3047
Línea 1... Línea 1...
1
import React, { useState, useEffect } from 'react'
1
import React, { useState, useEffect } from 'react'
2
import { useDispatch, useSelector } from 'react-redux'
2
import { useDispatch, useSelector } from 'react-redux'
3
import { IconButton, Typography } from '@mui/material'
3
import { IconButton, Typography } from '@mui/material'
4
import { Edit } from '@mui/icons-material'
4
import { Edit } from '@mui/icons-material'
Línea 5... Línea 5...
5
 
5
 
6
import { axios } from '@app/utils'
6
import { axios } from '@utils'
Línea 7... Línea 7...
7
import { addNotification } from '@app/redux/notification/notification.actions'
7
import { addNotification } from '@store/notification/notification.actions'
8
 
8
 
Línea 9... Línea 9...
9
import ProfileWidget from '../ProfileWidget'
9
import Widget from '@components/UI/Widget'
10
import LocationModal from './LocationModal'
10
import LocationModal from './LocationModal'
11
 
11
 
Línea 43... Línea 43...
43
 
43
 
44
        setAddress(data.formatted_address)
44
        setAddress(data.formatted_address)
45
        toggleModal()
45
        toggleModal()
46
      })
46
      })
47
      .catch((error) => {
-
 
48
        console.error(error)
47
      .catch((error) => {
49
        dispatch(addNotification({ style: 'danger', msg: error.message }))
48
        dispatch(addNotification({ style: 'danger', msg: error.message }))
50
      })
49
      })
Línea 51... Línea 50...
51
  }
50
  }
52
 
51
 
53
  useEffect(() => {
52
  useEffect(() => {
Línea 54... Línea 53...
54
    setAddress(defaultAddress)
53
    setAddress(defaultAddress)
55
  }, [defaultAddress])
54
  }, [defaultAddress])
56
 
55
 
-
 
56
  return (
57
  return (
57
    <>
58
    <>
58
      <Widget>
-
 
59
        <Widget.Header
59
      <ProfileWidget
60
          title={labels.location}
60
        title={labels.location}
61
          renderAction={() => {
61
        action={
62
            if (!edit) return
62
          edit && (
63
            return (
63
            <IconButton onClick={toggleModal}>
64
              <IconButton onClick={toggleModal}>
64
              <Edit />
65
                <Edit />
65
            </IconButton>
66
              </IconButton>
-
 
67
            )
-
 
68
          }}
66
          )
69
        />
-
 
70
 
67
        }
71
        <Widget.Body>
Línea 68... Línea 72...
68
      >
72
          <Typography variant='body1'>{address}</Typography>
69
        <Typography variant='body1'>{address}</Typography>
73
        </Widget.Body>
70
      </ProfileWidget>
74
      </Widget>
71
 
75