Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Add loading indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
mustofa-id committed Jan 12, 2020
1 parent 6fd0cf1 commit 388585a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import IconButton from '../components/widget/icon-button'

const IndexPage = ({ data }) => {
const { title, description, menuHome, social } = data.site.siteMetadata

function isLoading (e) {
e.target.classList.add('is-loading')
}

return (
<>
{/* Add seo props as you wish */}
Expand Down Expand Up @@ -51,6 +56,7 @@ const IndexPage = ({ data }) => {
{/* If wanna use button with icon you can use IconButton instead of Link */}
{menuHome.map((item, index) => (
<Link
onClick={isLoading}
className='button is-light'
key={`${index}--${item.name}`}
to={item.href}>
Expand Down

0 comments on commit 388585a

Please sign in to comment.