Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ In this Codesandbox, you have a complete environment with all you need to run yo
HTML tag to show them (_sprites_ property from the mock object contains them)

6. Create a link to the Pokemon's video so when you click it, redirects you to the video
on YouTube using the anchor _<a src=...>_ HTML tag
on YouTube using the anchor _<a href=...>_ HTML tag

## Submitting your work

Expand Down
9 changes: 8 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import React from "react";
import "./styles.css";
import { PokeCard } from "./components/PokeCard";
import { mockPokemonData as pokeData } from "./mock/pokeData";

export default function App() {
return (
<div className="App">
<h1>Welcome to your second mini challenge!</h1>
<PokeCard
name={pokeData.name}
img_default={pokeData.sprites.front_default}
img_shiny={pokeData.sprites.front_shiny}
video={pokeData.video}
/>
</div>
);
}
21 changes: 21 additions & 0 deletions src/components/PokeCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from "react";

export class PokeCard extends React.Component {
render() {
return (
<div>
<h1>{this.props.name}</h1>
<img
src={this.props.img_default}
alt={this.props.name + " default image"}
/>
<img
src={this.props.img_shiny}
alt={this.props.name + " shiny image"}
/>
 <p />
<a href={this.props.video}>Video</a>
</div>
);
}
}