Skip to content

Commit

Permalink
prepulate remaining fields when forms opens to edit resource; add ima…
Browse files Browse the repository at this point in the history
…ge tag so you can preview photo when editing resource b00tc4mp#484
  • Loading branch information
juditta99 committed Jun 16, 2024
1 parent 64b70e0 commit 589bcf5
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions staff/judy-grayland/project/app/src/pages/EditResource.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,21 @@ function EditResource() {
<Field name="title" inputId="title-input" value={resource.title}>
Título
</Field>
<Field name="description" inputId="description-input">
<Field
name="description"
inputId="description-input"
value={resource.description}
>
Descripción
</Field>
<Field name="image" inputId="image-input">
<Field name="image" inputId="image-input" value={resource.image}>
Imagen
</Field>
<Field name="link" inputId="link-input">
<img src={resource.image}></img>
<Field name="link" inputId="link-input" value={resource.link}>
Enlace
</Field>

<fieldset>
<legend>Selecciona los temas relacionados a la actividad</legend>
<Field
Expand Down Expand Up @@ -193,15 +199,20 @@ function EditResource() {
<Field name="title" inputId="title-input" value={resource.title}>
Título
</Field>
<Field name="author" inputId="author-input">
<Field name="author" inputId="author-input" value={resource.author}>
Autor
</Field>
<Field name="description" inputId="description-input">
<Field
name="description"
inputId="description-input"
value={resource.description}
>
Descripción
</Field>
<Field name="image" inputId="image-input">
<Field name="image" inputId="image-input" value={resource.image}>
Imagen
</Field>
<img src={resource.image}></img>
<fieldset>
<legend>Selecciona los temas relacionados a la actividad</legend>
<Field
Expand Down Expand Up @@ -260,10 +271,14 @@ function EditResource() {
<Field name="title" inputId="title-input" value={resource.title}>
Título
</Field>
<Field name="description" inputId="description-input">
<Field
name="description"
inputId="description-input"
value={resource.description}
>
Descripción
</Field>
<Field name="link" inputId="link-input">
<Field name="link" inputId="link-input" value={resource.link}>
Enlace
</Field>
<fieldset>
Expand Down Expand Up @@ -320,7 +335,7 @@ function EditResource() {
</>
)}
<Button onClick={handleCancel}>Cancelar</Button>
<Button type="submit">Crear</Button>
<Button type="submit">Actualizar</Button>
</Form>
</>
)
Expand Down

0 comments on commit 589bcf5

Please sign in to comment.