Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 7389 Rev 7390
Línea 26... Línea 26...
26
        setError,
26
        setError,
27
    } = useForm({
27
    } = useForm({
28
        defaultValues: {
28
        defaultValues: {
29
            description: "",
29
            description: "",
30
            share_width: "",
30
            share_width: "",
31
        },
31
        }
32
    });
32
    });
Línea 33... Línea 33...
33
 
33
 
34
    useEffect(() => {
34
    useEffect(() => {
35
        register("description", {
35
        register("description", {
Línea 52... Línea 52...
52
        IMAGE: "Tamaño recomendado: 720x720",
52
        IMAGE: "Tamaño recomendado: 720x720",
53
        FILE: "solo documentos PDF",
53
        FILE: "solo documentos PDF",
54
        VIDEO: "Video de extensión mp4, mpeg, webm"
54
        VIDEO: "Video de extensión mp4, mpeg, webm"
55
    }
55
    }
Línea -... Línea 56...
-
 
56
 
-
 
57
    const closeModal = () => {
-
 
58
        dispatch(closeShareModal())
-
 
59
    }
56
 
60
 
57
    useEffect(() => {
61
    useEffect(() => {
58
        clearErrors();
62
        clearErrors();
Línea 59... Línea 63...
59
    }, [isOpen]);
63
    }, [isOpen]);
Línea 76... Línea 80...
76
                        setError(key, { type: "required", message: value })
80
                        setError(key, { type: "required", message: value })
77
                    })
81
                    })
78
                }
82
                }
Línea 79... Línea 83...
79
 
83
 
80
                if (data.success) {
84
                if (data.success) {
81
                    dispatch(closeShareModal());
85
                    closeModal();
82
                    // reset data
86
                    // reset data
83
                    e.target.reset();
87
                    e.target.reset();
84
                    setValue("description", "");
88
                    setValue("description", "");
85
                    setValue("file", "");
89
                    setValue("file", "");
Línea 108... Línea 112...
108
    const onUploadedHandler = (files) => {
112
    const onUploadedHandler = (files) => {
109
        setValue("file", files);
113
        setValue("file", files);
110
        clearErrors("file");
114
        clearErrors("file");
111
    };
115
    };
Línea 112... Línea -...
112
 
-
 
Línea 113... Línea 116...
113
    console.log(state)
116
 
114
 
117
 
115
    return (
118
    return (
116
        <Modal
119
        <Modal
117
            show={true}
120
            show={isOpen}
118
            onHide={dispatch(closeShareModal())}
121
            onHide={closeModal}
119
            autoFocus={false}
122
            autoFocus={false}
120
        >
123
        >
121
            <form encType="multipart/form-data" onSubmit={handleSubmit(onSubmit)}>
124
            <form encType="multipart/form-data" onSubmit={handleSubmit(onSubmit)}>
122
                <Modal.Header closeButton>
125
                <Modal.Header closeButton>
123
                    <Modal.Title>Compartir una publicación</Modal.Title>
126
                    <Modal.Title>Compartir una publicación</Modal.Title>
124
                </Modal.Header>
127
                </Modal.Header>
125
                <Modal.Body>
128
                <Modal.Body>
126
                    <DescriptionInput
129
                    {/* <DescriptionInput
127
                        name="description"
130
                        name="description"
128
                        setValue={setValue}
131
                        setValue={setValue}
129
                    />
132
                    />
Línea 134... Línea 137...
134
                            modalType={modalType}
137
                            modalType={modalType}
135
                            onUploaded={onUploadedHandler}
138
                            onUploaded={onUploadedHandler}
136
                            settedFile={getValues("file")}
139
                            settedFile={getValues("file")}
137
                            recomendationText={recomendationText[modalType]}
140
                            recomendationText={recomendationText[modalType]}
138
                        />
141
                        />
139
                    }
142
                    } */}
140
                </Modal.Body>
143
                </Modal.Body>
141
                <Modal.Footer>
144
                <Modal.Footer>
142
                    <Button
145
                    <Button
143
                        size="sm"
146
                        size="sm"
144
                        type="submit"
147
                        type="submit"
Línea 147... Línea 150...
147
                    </Button>
150
                    </Button>
148
                    <Button
151
                    <Button
149
                        color="danger"
152
                        color="danger"
150
                        size="sm"
153
                        size="sm"
151
                        variant="danger"
154
                        variant="danger"
152
                        onClick={() => dispatch(closeShareModal())}
155
                        onClick={closeModal}
153
                    >
156
                    >
154
                        Cancelar
157
                        Cancelar
155
                    </Button>
158
                    </Button>
156
                </Modal.Footer>
159
                </Modal.Footer>
157
            </form>
160
            </form>