Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mizanxali committed Dec 12, 2021
1 parent 939c54b commit 92b6605
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 54 deletions.
5 changes: 2 additions & 3 deletions components/ClipCard.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Image from 'next/image'
import router, { useRouter } from 'next/router'
import { useRouter } from 'next/router'
import { FiHeart } from 'react-icons/fi'
import testthumbnail from '../public/test-thumbnail.png'
import { FaRegDotCircle } from 'react-icons/fa'

export default function ClipCard({ NFT, isOnLandingPage }) {
Expand All @@ -19,7 +18,7 @@ export default function ClipCard({ NFT, isOnLandingPage }) {
return (
<div className={`bg-gray-light px-2 py-3 rounded-xl ${isOnLandingPage && 'w-1/3'}`}>
<div className='w-full h-40 relative'>
<FaRegDotCircle className='text-blue text-xl z-10 top-1 left-0 absolute' />
{tag === 'Casual' ? <FaRegDotCircle className='text-blue text-xl z-10 top-1 left-0 absolute' /> : <FaRegDotCircle className='text-yellow text-xl z-10 top-1 left-0 absolute' />}
<div className='z-0'>
<Image
className='z-0'
Expand Down
1 change: 0 additions & 1 deletion components/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Link from 'next/link'
import Image from 'next/image'

import logo from '../public/recon.png'
Expand Down
1 change: 0 additions & 1 deletion components/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Link from 'next/link'
import Image from 'next/image'
import { CgProfile } from 'react-icons/cg'
import { IoWalletOutline } from 'react-icons/io5'

import logo from '../public/recon.png'

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"react": "17.0.2",
"react-dom": "17.0.2",
"react-icons": "^4.3.1",
"react-responsive-carousel": "^3.2.22",
"video-react": "^0.14.1",
"web3modal": "^1.9.4"
},
Expand Down
1 change: 1 addition & 0 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ function MyApp({ Component, pageProps }) {
ownedNFTs={ownedNfts}
soldNFTs={soldNfts}
walletAddress={walletAddress}
isLoaded={isLoaded}
/>
}

Expand Down
1 change: 0 additions & 1 deletion pages/about/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Head from 'next/head'
import Footer from '../../components/Footer'
import Navbar from '../../components/Navbar'

export default function Explore() {
Expand Down
17 changes: 0 additions & 17 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Image from 'next/image'
import Link from 'next/link'
import Head from 'next/head'
import Navbar from '../components/Navbar'
Expand All @@ -7,13 +6,8 @@ import ClipCard from '../components/ClipCard'
import { GiWallet } from 'react-icons/gi'
import { BsCollectionPlayFill, BsArrowRight } from 'react-icons/bs'
import { MdManageSearch } from 'react-icons/md'
import valorantgif from '../public/valorant-gif.webp'
import csgogif from '../public/csgo-gif.webp'
import fortnitegif from '../public/fortnite-gif.webp'
import TrendingGameCard from '../components/TrendingGameCard'
import { GAME_NAMES } from '../constants'
import { Carousel } from 'react-responsive-carousel'
import 'react-responsive-carousel/lib/styles/carousel.min.css'
import { FiArrowRight } from 'react-icons/fi'

export default function Home({ NFTs }) {
Expand All @@ -39,17 +33,6 @@ export default function Home({ NFTs }) {
</section>
<section className='h-full w-1/2 bg-primary flex flex-col items-center justify-center'>
{randomNFT && <ClipCard NFT={randomNFT} isOnLandingPage={true} />}
{/* <Carousel infiniteLoop={true} autoPlay={true} showStatus={false} showArrows={false} showIndicators={false}>
<div className='w-full h-full'>
<Image src={valorantgif} width={500} height={250} />
</div>
<div className='w-full h-full'>
<Image src={csgogif} width={500} height={250} />
</div>
<div className='w-full h-full'>
<Image src={fortnitegif} width={500} height={250} />
</div>
</Carousel> */}
</section>
</main>
<div className='py-8 w-5/6 mx-auto'>
Expand Down
6 changes: 1 addition & 5 deletions pages/nfts/[nftId].js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Head from 'next/head'
import Image from 'next/image'
import { useRouter } from 'next/router'
import { Player } from 'video-react'
import 'video-react/dist/video-react.css'
Expand All @@ -8,11 +7,8 @@ import { FaRegDotCircle } from 'react-icons/fa'
import { ethers } from 'ethers'
import Web3Modal from 'web3modal'

import NFT from '../../artifacts/contracts/NFT.sol/NFT.json'
import Market from '../../artifacts/contracts/NFTMarket.sol/NFTMarket.json'

import Navbar from '../../components/Navbar'
import { useState } from 'react'

export default function NFTPage({ NFTs, ownedNFTs, createdNFTs, soldNFTs }) {
const router = useRouter()
Expand Down Expand Up @@ -101,7 +97,7 @@ export default function NFTPage({ NFTs, ownedNFTs, createdNFTs, soldNFTs }) {
{showSellerAddress && <h6 className='my-2 text-gray-mute'>Created by <span className='text-primary text-xs'>{sellerFormattedAddress}</span></h6>}
{showOwnerAddress && <h6 className='my-2 text-gray-mute'>Owned by <span className='text-primary text-xs'>{ownerFormattedAddress}</span></h6>}
<h6 className='text-gray-mute'>
<FaRegDotCircle className='text-yellow inline mx-1' />
{tag === 'Casual' ? <FaRegDotCircle className='text-blue inline mx-1' /> : <FaRegDotCircle className='text-yellow inline mx-1' />}
{tag}
</h6>
<h6 className='text-gray-mute'>
Expand Down
16 changes: 9 additions & 7 deletions pages/profile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ import { AiOutlineYoutube } from 'react-icons/ai'
import { FiTwitter, FiTwitch } from 'react-icons/fi'
import { MdOutlineEdit } from 'react-icons/md'

import pfp from '../../public/pfp.png'
import logo from '../../public/recon.png'

export default function Profile({ ownedNFTs, createdNFTs, soldNFTs, walletAddress }) {
const [tab, setTab] = useState('owned')

let formattedAddress = ''

if (walletAddress) {
const addressLength = walletAddress.length
const formattedAddress = `${walletAddress.charAt(0)}${walletAddress.charAt(1)}${walletAddress.charAt(2)}${walletAddress.charAt(3)}....${walletAddress.charAt(addressLength - 4)}${walletAddress.charAt(addressLength - 3)}${walletAddress.charAt(addressLength - 2)}${walletAddress.charAt(addressLength - 1)}`
formattedAddress = `${walletAddress.charAt(0)}${walletAddress.charAt(1)}${walletAddress.charAt(2)}${walletAddress.charAt(3)}....${walletAddress.charAt(addressLength - 4)}${walletAddress.charAt(addressLength - 3)}${walletAddress.charAt(addressLength - 2)}${walletAddress.charAt(addressLength - 1)}`
}

return (
Expand Down Expand Up @@ -58,14 +60,14 @@ export default function Profile({ ownedNFTs, createdNFTs, soldNFTs, walletAddres

const ProfileInfo = ({ walletAddress, totalOwned, totalCreated, totalSold }) => {
return (
<div className='w-80 absolute top-36 left-14 z-10 rounded-xl bg-gray-light drop-shadow-2xl border-2 border-black'>
<div className='w-80 absolute top-36 left-10 z-10 rounded-xl bg-gray-light drop-shadow-2xl border-2 border-black'>
<div className='p-2 flex flex-col items-center justify-evenly'>
<div className='my-5 flex flex-col items-center justify-center'>
<Image
className='mt-3 cursor-pointer'
src={pfp}
width={120}
height={120}
className='mt-3 cursor-pointer bg-primary rounded-lg'
src={logo}
width={130}
height={40}
/>
<h6 className='mt-3 text-gray-mute font-semibold text-lg'>{walletAddress}</h6>
</div>
Expand Down
20 changes: 2 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2874,7 +2874,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==

classnames@^2.2.5, classnames@^2.2.6:
classnames@^2.2.6:
version "2.3.1"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e"
integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==
Expand Down Expand Up @@ -8195,7 +8195,7 @@ promise-to-callback@^1.0.0:
is-fn "^1.0.0"
set-immediate-shim "^1.0.1"

prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2:
prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
Expand Down Expand Up @@ -8461,13 +8461,6 @@ react-dom@^16.8.6:
prop-types "^15.6.2"
scheduler "^0.19.1"

react-easy-swipe@^0.0.21:
version "0.0.21"
resolved "https://registry.yarnpkg.com/react-easy-swipe/-/react-easy-swipe-0.0.21.tgz#ce9384d576f7a8529dc2ca377c1bf03920bac8eb"
integrity sha512-OeR2jAxdoqUMHIn/nS9fgreI5hSpgGoL5ezdal4+oO7YSSgJR8ga+PkYGJrSrJ9MKlPcQjMQXnketrD7WNmNsg==
dependencies:
prop-types "^15.5.8"

react-icons@^4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.3.1.tgz#2fa92aebbbc71f43d2db2ed1aed07361124e91ca"
Expand Down Expand Up @@ -8495,15 +8488,6 @@ [email protected]:
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.3.tgz#721d4657672d400c5e3c75d063c4a85fb2d5d68f"
integrity sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg==

react-responsive-carousel@^3.2.22:
version "3.2.22"
resolved "https://registry.yarnpkg.com/react-responsive-carousel/-/react-responsive-carousel-3.2.22.tgz#6281603daa33656940d01e207f511b83c0093c70"
integrity sha512-/r7dsIaN+l417IYIS0Fr7Z5VlpK3KYnTIIsdVCWSqtuJRIZNM+qdBIA4RIbzQtuW/ZBTnQanBecblCxg0HCqLQ==
dependencies:
classnames "^2.2.5"
prop-types "^15.5.8"
react-easy-swipe "^0.0.21"

[email protected]:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
Expand Down

0 comments on commit 92b6605

Please sign in to comment.