Skip to content

Commit

Permalink
add message isloading
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignaherrero committed Apr 7, 2022
1 parent 6f4a7b0 commit 7d197ee
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,34 +125,36 @@ export default function Home() {
);
})}

{/* */}
<div className="flex space-x-2 justify-center">
<button
type="button"
data-mdb-ripple="true"
data-mdb-ripple-color="light"
className="inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out"
disabled={articles.found === "pending"}
onClick={() => {
setPage(page - 1);
}}
>
-
</button>
{page}
<button
type="button"
data-mdb-ripple="true"
data-mdb-ripple-color="light"
className="inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out"
disabled={articles.found === "pending"}
onClick={() => {
setPage(page + 1);
}}
>
+
</button>
</div>
{articles.found === "found" ? (
<div className="flex space-x-2 justify-center">
<button
type="button"
data-mdb-ripple="true"
data-mdb-ripple-color="light"
className="inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out"
disabled={articles.found === "pending"}
onClick={() => {
setPage(page - 1);
}}
>
-
</button>
{page}
<button
type="button"
data-mdb-ripple="true"
data-mdb-ripple-color="light"
className="inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out"
onClick={() => {
setPage(page + 1);
}}
>
+
</button>
</div>
):(
<p>cargando...</p>
)}
</>
);
}

1 comment on commit 7d197ee

@vercel
Copy link

@vercel vercel bot commented on 7d197ee Apr 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

challenge-atomik – ./

challenge-atomik-nacho93.vercel.app
challenge-atomik-git-main-nacho93.vercel.app
challenge-atomik.vercel.app

Please sign in to comment.