Skip to content

Commit

Permalink
added hashloaders
Browse files Browse the repository at this point in the history
  • Loading branch information
4darsh-Dev committed Dec 15, 2024
1 parent 5add95f commit 393b7a9
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 31 deletions.
11 changes: 11 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"react-countup": "^6.5.3",
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.1",
"react-spinners": "^0.15.0",
"three": "^0.168.0"
},
"devDependencies": {
Expand Down
70 changes: 41 additions & 29 deletions frontend/src/pages/CreatorsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import './CreatorsPage.css'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faGithub } from '@fortawesome/free-brands-svg-icons'
import CountUp from 'react-countup'
import { HashLoader } from 'react-spinners'

const CreatorsPage = () => {
const [contributors, setContributors] = useState([])
const [repoStats, setRepoStats] = useState({})
Expand Down Expand Up @@ -90,38 +92,45 @@ const CreatorsPage = () => {
// Render contributors
const renderContributors = () => {
return (
<div
className="contributor-contributors-grid"
id="contributorsGrid"
>
{contributors.map((contributor) => (
// adding the preloader


<div
className="contributor-contributor-card"
key={contributor.login}
className="contributor-contributors-grid"
id="contributorsGrid"
>
<img
src={contributor.avatar_url}
alt={contributor.login}
/>
<h3>{contributor.login}</h3>
<p>{contributor.type}</p>
<div className="contributor-contributions">
{contributor.contributions} contributions
</div>
<div className="contributor-footer">
<a
href={contributor.html_url}
target="_blank"
rel="noopener noreferrer"
>
{getIcon('external-link')}
<FontAwesomeIcon icon={faGithub} />
</a>
{getIcon('github')}
{contributors.map((contributor) => (
<div
className="contributor-contributor-card"
key={contributor.login}
>
<img
src={contributor.avatar_url}
alt={contributor.login}
/>
<h3>{contributor.login}</h3>
<p>{contributor.type}</p>
<div className="contributor-contributions">
{contributor.contributions} contributions
</div>
<div className="contributor-footer">
<a
href={contributor.html_url}
target="_blank"
rel="noopener noreferrer"
>
{getIcon('external-link')}
<FontAwesomeIcon icon={faGithub} />
</a>
{getIcon('github')}
</div>
</div>
))}
</div>
))}
</div>




)
}

Expand All @@ -138,7 +147,10 @@ const CreatorsPage = () => {
<section className=" dark:bg-slate-900">
<div className="contributor-contributors">
{loading ? (
<div id="loading" className="contributor-loading"></div>
// <div id="loading" className="contributor-loading"></div>
<div className="flex justify-center items-center min-h-screen">
<HashLoader color={'#252550'} size={50} loading={loading} />
</div>
) : (
<>
<h2 className="dark:text-white">
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/pages/ExplorePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import NFTCard from '../components/NFTCard'
import { connectWallet } from '../utils/ethereum'
import { ethers } from 'ethers'
import { useNavigate } from 'react-router-dom'
import { HashLoader } from 'react-spinners';

const ExplorePage = () => {
const [nfts, setNfts] = useState([])
Expand Down Expand Up @@ -125,9 +126,13 @@ const ExplorePage = () => {

if (loading) {
return (
<div className="text-center py-10">
Loading NFTs... Please wait.
// <div className="text-center py-10">
// Loading NFTs... Please wait.
// </div>
<div className="flex justify-center items-center min-h-screen">
<HashLoader color={"#252550"} size={50} loading={loading} />
</div>

)
}

Expand Down

0 comments on commit 393b7a9

Please sign in to comment.