Skip to content

Commit

Permalink
create topic component b00tc4mp#482
Browse files Browse the repository at this point in the history
  • Loading branch information
juditta99 committed May 1, 2024
1 parent 9a0da20 commit e0248f6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions staff/judy-grayland/project/app/src/components/Topic.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function Topic(props) {
return <p>{props.topics}</p>
}

export default Topic

// it receives topics array. i need to map over that array. declare object before function Topic. call it for example translation. make key value pairs in which the key is the english and the value the spanish equivalent.
3 changes: 2 additions & 1 deletion staff/judy-grayland/project/app/src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Field from './Field'
import Button from './Button'
import Form from './Form'
import Topic from './Topic'

export { Field, Button, Form }
export { Field, Button, Form, Topic }
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Button } from '../components'
import { Button, Topic } from '../components'

function ResourceActivity(props) {
return (
<article className="resource-activity">
{/* We hardcode the type of resource because we already know what it is because this component is only rendered for this type of resource. If we write props.resourceType we get it from the database and it's in English */}
{/* We hardcode the type of resource because we already know what it is since this component is only rendered for this type of resource. If we write props.resourceType we get it from the database and it's in English */}

<span>Actividad</span>
<h2>{props.title}</h2>

<img src={props.image}></img>
<p>{props.description} </p>
<p>{props.description}</p>
<a>{props.link}</a>
<p>{props.topic}</p>
<Topic topics={props.topic} />
<Button>Editar</Button>
<Button>Eliminar</Button>
</article>
Expand Down

0 comments on commit e0248f6

Please sign in to comment.