Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 7788 Rev 7789
Línea 84... Línea 84...
84
                        setError(key, { type: "required", message: value })
84
                        setError(key, { type: "required", message: value })
85
                    })
85
                    })
86
                } */
86
                } */
Línea 87... Línea 87...
87
 
87
 
88
                if (data.success) {
-
 
89
                    closeModal();
-
 
90
                    // reset data
88
                if (data.success) {
91
                    e.target.reset();
89
                    e.target.reset();
92
                    setValue("description", "");
90
                    setValue("description", "");
93
                    setValue("file", "");
91
                    setValue("file", "");
-
 
92
                    clearErrors();
-
 
93
 
94
                    clearErrors();
94
                    closeModal();
95
                    dispatch(addNotification({
95
                    dispatch(addNotification({
96
                        style: "success",
96
                        style: "success",
97
                        msg: "La publicación ha sido compartida",
97
                        msg: "La publicación ha sido compartida",
Línea 122... Línea 122...
122
    const onUploadedHandler = (files) => {
122
    const onUploadedHandler = (files) => {
123
        setValue("file", files);
123
        setValue("file", files);
124
        clearErrors("file");
124
        clearErrors("file");
125
    };
125
    };
Línea 126... Línea -...
126
 
-
 
127
    if (loading) {
-
 
128
        return <Spinner />
-
 
129
    }
-
 
Línea 130... Línea 126...
130
 
126
 
131
 
127
 
132
    return (
128
    return (
133
        <Modal
129
        <Modal
Línea 138... Línea 134...
138
            <form encType="multipart/form-data" onSubmit={handleSubmit(onSubmit)}>
134
            <form encType="multipart/form-data" onSubmit={handleSubmit(onSubmit)}>
139
                <Modal.Header closeButton>
135
                <Modal.Header closeButton>
140
                    <Modal.Title>Compartir una publicación</Modal.Title>
136
                    <Modal.Title>Compartir una publicación</Modal.Title>
141
                </Modal.Header>
137
                </Modal.Header>
142
                <Modal.Body>
138
                <Modal.Body>
143
                    <DescriptionInput
-
 
144
                        name="description"
-
 
145
                        setValue={setValue}
-
 
146
                    />
-
 
147
                    {errors.description && <p>{errors.description.message}</p>}
-
 
148
                    {
139
                    {
-
 
140
                        loading
-
 
141
                            ? <Spinner />
-
 
142
                            :
-
 
143
                            <>
-
 
144
                                <DescriptionInput
-
 
145
                                    name="description"
-
 
146
                                    setValue={setValue}
-
 
147
                                />
-
 
148
                                {errors.description && <p>{errors.description.message}</p>}
-
 
149
                                {
149
                        modalType !== shareModalTypes.POST
150
                                    modalType !== shareModalTypes.POST
150
                        &&
151
                                    &&
151
                        <DropzoneComponent
152
                                    <DropzoneComponent
152
                            modalType={modalType}
153
                                        modalType={modalType}
153
                            onUploaded={onUploadedHandler}
154
                                        onUploaded={onUploadedHandler}
154
                            settedFile={getValues("file")}
155
                                        settedFile={getValues("file")}
155
                            recomendationText={recomendationText[modalType]}
156
                                        recomendationText={recomendationText[modalType]}
-
 
157
                                    />
-
 
158
                                }
-
 
159
                                {errors.file && <p>{errors.file.message}</p>}
156
                        />
160
                            </>
157
                    }
161
                    }
158
                </Modal.Body>
162
                </Modal.Body>
159
                <Modal.Footer>
163
                <Modal.Footer>
160
                    <Button
164
                    <Button
161
                        size="sm"
165
                        size="sm"