Skip to content

Commit

Permalink
Merge branch 'release/v0.1.0' of github.com:WildCodeSchool/2024-12-or…
Browse files Browse the repository at this point in the history
…leans-cda-project2-team-a into release/v0.1.0
  • Loading branch information
TheoSkymel committed Feb 26, 2025
2 parents 1ed55e3 + c7db44e commit ff6d8db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/components/comics.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export default function Comics({ data, onClick }) {
</button>
<div className='comics'>
{data.map((dataItem) => {
const detailsUrl = dataItem.urls.find((element) => element['type'] === 'detail').url;
return (
<Link
to={`/comics/${dataItem.id}`}
key={dataItem.id}
className='comic-card'
style={{
Expand All @@ -44,9 +44,6 @@ export default function Comics({ data, onClick }) {
e.stopPropagation();
onClick(dataItem.id);
}}
href={detailsUrl}
target='_blank'
rel='noreferrer'
>
<div className='comics-title'>
<h3>{dataItem.title}</h3>
Expand Down
5 changes: 3 additions & 2 deletions src/components/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default function Search() {
const handleSubmit = (event) => {
event.preventDefault();
getCharacterData();
setCharacterName('');
};

const getCharacterData = () => {
Expand Down Expand Up @@ -57,8 +58,8 @@ export default function Search() {

return (
<>
<form onSubmit={handleSubmit}>
<input type='text' placeholder='Search' onChange={handleChange} />
<form className='' onSubmit={handleSubmit}>
<input type='text' placeholder='Search' value={characterName} onChange={handleChange} />
</form>

{!comicData && characterData && characterData.results[0] && (
Expand Down

0 comments on commit ff6d8db

Please sign in to comment.