Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 6019 Rev 6024
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
Línea 2... Línea 2...
2
 
2
 
Línea 3... Línea 3...
3
const Location = ({ locations }) => {
3
const Location = ({ locations = [] }) => {
Línea 4... Línea 4...
4
 
4
 
Línea 5... Línea 5...
5
    const editLocation = (url) => { }
5
    const editLocation = (url) => { }
6
 
6
 
7
    const deleteLocation = (url) => { }
7
    const deleteLocation = (url) => { }
8
 
8
 
9
    return (
9
    return (
10
        <div class="user-profile-extended-ov st2">
10
        <div className="user-profile-extended-ov st2">
11
            <h3>
11
            <h3>
12
                Ubicaciones
12
                Ubicaciones
13
                <button class="btn btn-location-add">
13
                <button className="btn btn-location-add">
14
                    <i class="fa fa-plus-square" />
14
                    <i className="fa fa-plus-square" />
15
                </button>
15
                </button>
16
            </h3>
16
            </h3>
17
            <span id="locations-records">
-
 
18
                {
17
            <span id="locations-records">
19
                    locations
18
                {
20
                        ?
19
                    locations.map((location, index) => (
21
                        locations.map((location) => (
20
                        <>
22
                            <p>
21
                            <p key={index}>
23
                                {location.formatted_address}
22
                                {location.formatted_address}
-
 
23
                                {location.is_main === 'y' ? " (Principal)" : ""}
24
                                {location.is_main === 'y' ? " (Principal)" : ""}
24
                                <button
25
                                <button
25
                                    onClick={() => editLocation(location.link_edit)}
26
                                    onClick={() => editLocation(location.link_edit)}
26
                                    className="btn btn-location-edit"
27
                                    class="btn btn-location-edit"
27
                                    style={{ padding: '.3rem' }}
28
                                >
28
                                >
29
                                    <i class="fa fa-pencil" />
29
                                    <i className="fa fa-pencil" />
-
 
30
                                </button>
30
                                </button>
31
                                <button
31
                                <button
32
                                    onClick={() => deleteLocation(location.link_delete)}
32
                                    onClick={() => deleteLocation(location.link_delete)}
33
                                    className="btn btn-location-delete"
33
                                    class="btn btn-location-delete"
34
                                    style={{ padding: '.3rem' }}
34
                                >
35
                                >
-
 
36
                                    <i className="fa fa-trash" />
35
                                    <i class="fa fa-trash" />
37
                                </button>
36
                                </button>
38
                            </p>
-
 
39
                            {
37
                            </p>
40
                                locations[index + 1] && <hr />
38
                        ))
41
                            }
39
                        :
42
                        </>
40
                        <hr />
43
                    ))
41
                }
44
                }