Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 7476 Rev 7783
Línea 6... Línea 6...
6
import { shareModalTypes } from "../redux/share-modal/shareModal.types";
6
import { shareModalTypes } from "../redux/share-modal/shareModal.types";
7
import { closeShareModal } from "../redux/share-modal/shareModal.actions";
7
import { closeShareModal } from "../redux/share-modal/shareModal.actions";
8
import { useDispatch, useSelector } from "react-redux";
8
import { useDispatch, useSelector } from "react-redux";
9
import DropzoneComponent from "./Dropzone/DropzoneComponent";
9
import DropzoneComponent from "./Dropzone/DropzoneComponent";
10
import { addFeed, fetchFeeds } from "../redux/feed/feed.actions";
10
import { addFeed, fetchFeeds } from "../redux/feed/feed.actions";
-
 
11
import { addNotification } from "../redux/notification/notification.actions";
-
 
12
import Spinner from "./Spinner";
Línea 11... Línea 13...
11
 
13
 
Línea 12... Línea 14...
12
const ShareModal = () => {
14
const ShareModal = () => {
13
 
15
 
Línea 88... Línea 90...
88
                    // reset data
90
                    // reset data
89
                    e.target.reset();
91
                    e.target.reset();
90
                    setValue("description", "");
92
                    setValue("description", "");
91
                    setValue("file", "");
93
                    setValue("file", "");
92
                    clearErrors();
94
                    clearErrors();
-
 
95
                    dispatch(addNotification({
-
 
96
                        style: "success",
93
                    console.log("La publicación ha sido compartida")
97
                        msg: "La publicación ha sido compartida",
-
 
98
                    }))
Línea 94... Línea 99...
94
 
99
 
95
                    if (currentPage && timelineUrl) {
100
                    if (currentPage && timelineUrl) {
96
                        dispatch(fetchFeeds(timelineUrl, currentPage))
101
                        dispatch(fetchFeeds(timelineUrl, currentPage))
Línea 102... Línea 107...
102
 
107
 
103
                    return dispatch(addFeed(newFeed));
108
                    return dispatch(addFeed(newFeed));
Línea -... Línea 109...
-
 
109
                }
-
 
110
 
104
                }
111
 
-
 
112
                dispatch(addNotification({
Línea 105... Línea 113...
105
 
113
                    style: "error",
Línea 106... Línea 114...
106
 
114
                    msg: "Ha ocurrido un error",
107
                console.log("Ha ocurrido un error")
115
                }))
Línea 126... Línea 134...
126
            <form encType="multipart/form-data" onSubmit={handleSubmit(onSubmit)}>
134
            <form encType="multipart/form-data" onSubmit={handleSubmit(onSubmit)}>
127
                <Modal.Header closeButton>
135
                <Modal.Header closeButton>
128
                    <Modal.Title>Compartir una publicación</Modal.Title>
136
                    <Modal.Title>Compartir una publicación</Modal.Title>
129
                </Modal.Header>
137
                </Modal.Header>
130
                <Modal.Body>
138
                <Modal.Body>
131
                    <DescriptionInput
-
 
132
                        name="description"
-
 
133
                        setValue={setValue}
-
 
134
                    />
-
 
135
                    {
139
                    {
-
 
140
                        loading
-
 
141
                            ?
-
 
142
                            <Spinner />
-
 
143
                            :
-
 
144
                            <>
-
 
145
                                <DescriptionInput
-
 
146
                                    name="description"
-
 
147
                                    setValue={setValue}
-
 
148
                                />
-
 
149
                                {
136
                        modalType !== shareModalTypes.POST
150
                                    modalType !== shareModalTypes.POST
137
                        &&
151
                                    &&
138
                        <DropzoneComponent
152
                                    <DropzoneComponent
139
                            modalType={modalType}
153
                                        modalType={modalType}
140
                            onUploaded={onUploadedHandler}
154
                                        onUploaded={onUploadedHandler}
141
                            settedFile={getValues("file")}
155
                                        settedFile={getValues("file")}
142
                            recomendationText={recomendationText[modalType]}
156
                                        recomendationText={recomendationText[modalType]}
-
 
157
                                    />
-
 
158
                                }
143
                        />
159
                            </>
144
                    }
160
                    }
145
                </Modal.Body>
161
                </Modal.Body>
146
                <Modal.Footer>
162
                <Modal.Footer>
147
                    <Button
163
                    <Button
148
                        size="sm"
164
                        size="sm"
149
                        type="submit"
165
                        type="submit"
-
 
166
                        disabled={loading}
150
                    >
167
                    >
151
                        Enviar
168
                        Enviar
152
                    </Button>
169
                    </Button>
153
                    <Button
170
                    <Button
154
                        color="danger"
171
                        color="danger"
155
                        size="sm"
172
                        size="sm"
156
                        variant="danger"
173
                        variant="danger"
157
                        onClick={closeModal}
174
                        onClick={closeModal}
-
 
175
                        disabled={loading}
158
                    >
176
                    >
159
                        Cancelar
177
                        Cancelar
160
                    </Button>
178
                    </Button>
161
                </Modal.Footer>
179
                </Modal.Footer>
162
            </form>
180
            </form>