diff --git a/blockchain/NEARprotocol/nft-mintos-contract/mint.sh b/blockchain/NEARprotocol/nft-mintos-contract/mint.sh index 8a4c563..271ecc8 100755 --- a/blockchain/NEARprotocol/nft-mintos-contract/mint.sh +++ b/blockchain/NEARprotocol/nft-mintos-contract/mint.sh @@ -3,19 +3,19 @@ CONTRACT=dev-1651543210027-92386991020888 USERID=mzterdox.testnet echo 'Minting nfts...' -near call $CONTRACT nft_mint '{"token_id": "101", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 +near call $CONTRACT nft_mint '{"token_id": "201", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 -near call $CONTRACT nft_mint '{"token_id": "102", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 +near call $CONTRACT nft_mint '{"token_id": "202", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 -near call $CONTRACT nft_mint '{"token_id": "103", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 +near call $CONTRACT nft_mint '{"token_id": "203", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 -near call $CONTRACT nft_mint '{"token_id": "104", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 +near call $CONTRACT nft_mint '{"token_id": "204", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 -near call $CONTRACT nft_mint '{"token_id": "105", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 +near call $CONTRACT nft_mint '{"token_id": "205", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 -near call $CONTRACT nft_mint '{"token_id": "106", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 +near call $CONTRACT nft_mint '{"token_id": "206", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 -near call $CONTRACT nft_mint '{"token_id": "107", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 +near call $CONTRACT nft_mint '{"token_id": "207", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 -near call $CONTRACT nft_mint '{"token_id": "108", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 +near call $CONTRACT nft_mint '{"token_id": "208", "receiver_id": "'$USERID'","metadata": {"title": "NFT Title", "description":"NFT Description", "media": "https://ipfs.infura.io/ipfs/QmcHkMAknB68W2iqhuGXwJifaf7eQEP92SdNt97ieJGNHY"}}' --accountId $USERID --amount 3 diff --git a/blockchain/NEARprotocol/nft-mintos-contract/sale.sh b/blockchain/NEARprotocol/nft-mintos-contract/sale.sh index 8cd719f..56113f4 100755 --- a/blockchain/NEARprotocol/nft-mintos-contract/sale.sh +++ b/blockchain/NEARprotocol/nft-mintos-contract/sale.sh @@ -5,20 +5,20 @@ USERID=mzterdox.testnet echo 'Putting nfts on sale...' -near call $CONTRACT nft_approve '{"token_id": "101", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"4000000000000000000000000\"}" }' --accountId $USERID --amount 3 +near call $CONTRACT nft_approve '{"token_id": "201", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"4000000000000000000000000\"}" }' --accountId $USERID --amount 3 -near call $CONTRACT nft_approve '{"token_id": "102", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"5000000000000000000000000\"}" }' --accountId $USERID --amount 3 +near call $CONTRACT nft_approve '{"token_id": "202", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"5000000000000000000000000\"}" }' --accountId $USERID --amount 3 -near call $CONTRACT nft_approve '{"token_id": "103", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"6000000000000000000000000\"}" }' --accountId $USERID --amount 3 +near call $CONTRACT nft_approve '{"token_id": "203", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"6000000000000000000000000\"}" }' --accountId $USERID --amount 3 -near call $CONTRACT nft_approve '{"token_id": "104", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"7000000000000000000000000\"}" }' --accountId $USERID --amount 3 +near call $CONTRACT nft_approve '{"token_id": "204", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"7000000000000000000000000\"}" }' --accountId $USERID --amount 3 -near call $CONTRACT nft_approve '{"token_id": "105", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"8000000000000000000000000\"}" }' --accountId $USERID --amount 3 +near call $CONTRACT nft_approve '{"token_id": "205", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"8000000000000000000000000\"}" }' --accountId $USERID --amount 3 -near call $CONTRACT nft_approve '{"token_id": "106", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"9000000000000000000000000\"}" }' --accountId $USERID --amount 3 +near call $CONTRACT nft_approve '{"token_id": "206", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"9000000000000000000000000\"}" }' --accountId $USERID --amount 3 -near call $CONTRACT nft_approve '{"token_id": "107", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"10000000000000000000000000\"}" }' --accountId $USERID --amount 3 +near call $CONTRACT nft_approve '{"token_id": "207", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"10000000000000000000000000\"}" }' --accountId $USERID --amount 3 -near call $CONTRACT nft_approve '{"token_id": "108", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"11000000000000000000000000\"}" }' --accountId $USERID --amount 3 +near call $CONTRACT nft_approve '{"token_id": "208", "account_id":"'$MARKETCONTRACT'","msg":"{\"sale_conditions\": \"11000000000000000000000000\"}" }' --accountId $USERID --amount 3 diff --git a/frontend/components/Gallery/GalleryInfo.tsx b/frontend/components/Gallery/GalleryInfo.tsx index ad2e338..57ecc17 100644 --- a/frontend/components/Gallery/GalleryInfo.tsx +++ b/frontend/components/Gallery/GalleryInfo.tsx @@ -105,11 +105,11 @@ export default function GalleryInfo() { tokens={searchBarTokens} /> -
+ {/*
{categories.map((category, i) => ( ))} -
+
*/}

@@ -136,7 +136,7 @@ export default function GalleryInfo() {
@@ -149,7 +149,7 @@ export default function GalleryInfo() {
-
+ {/*
{categories.map((category, i) => ( ))} -
+
*/}
{categories.map((category, i) => ( diff --git a/frontend/components/Layout.tsx b/frontend/components/Layout.tsx index 8fdaa06..d75ed47 100644 --- a/frontend/components/Layout.tsx +++ b/frontend/components/Layout.tsx @@ -47,7 +47,7 @@ function Layout({ children }: LayoutProps) {
- {children} +
{children}
{/* Mobile navs goes on the footer of the page, so no footer will be shown on this screen size. */}
diff --git a/frontend/components/NFT/NFTGalleryPreview.tsx b/frontend/components/NFT/NFTGalleryPreview.tsx index 09102ad..9750088 100644 --- a/frontend/components/NFT/NFTGalleryPreview.tsx +++ b/frontend/components/NFT/NFTGalleryPreview.tsx @@ -3,6 +3,7 @@ import React from 'react'; import WholeToken from '../../models/WholeToken'; import Token from '../../models/Token'; import { ONE_NEAR_IN_YOCTO, toFixed } from '../utils'; +import useUser from '../../hooks/useUser'; interface NFTGalleryPreviewProps { data?: WholeToken; @@ -14,13 +15,33 @@ export default function NFTGalleryPreview({ className, }: NFTGalleryPreviewProps) { const router = useRouter(); + const [user] = useUser(); + const [isLogged, setIsLogged] = React.useState(true); + const checkUser = () => { + if (user) { + setIsLogged(true); + } else { + setIsLogged(false); + } + }; + + // React.useEffect(() => { + // if (user) { + // setIsLogged(true); + // } else { + // setIsLogged(false); + // } + // }, []); return (

-
-
- {data?.sale?.sale_conditions ? ( -
- {`${ - Number(data?.sale?.sale_conditions) / ONE_NEAR_IN_YOCTO - } N`} +
+ {isLogged ? ( +
+
+ {data?.sale?.sale_conditions ? ( +
+ {`${ + Number(data?.sale?.sale_conditions) / + ONE_NEAR_IN_YOCTO + } N`} +
+ ) : ( + + )}
- ) : ( - - )} -
+
+ ) : ( +
+ +
+ )}
diff --git a/frontend/components/common/MobileNav.tsx b/frontend/components/common/MobileNav.tsx index d695e20..0cc40ce 100644 --- a/frontend/components/common/MobileNav.tsx +++ b/frontend/components/common/MobileNav.tsx @@ -27,8 +27,8 @@ export default function MobileNav() { } return ( -
-
+
+
- {showMenu ? ( -
-
-

router.push('/app')} - > - Home -

-

router.push('/app/gallery')} - > - Gallery -

-

router.push('/app/mint')} - > - Mint -

-

router.push('/app/profile')} - > - Profile -

+
+ {showMenu ? ( +
+
+

router.push('/app')} + > + Home +

+

router.push('/app/gallery')} + > + Gallery +

+

router.push('/app/mint')} + > + Mint +

+

router.push('/app/profile')} + > + Profile +

+ {user ? ( + + ) : ( +

logIn()} + > + Login +

+ )} +
-
- ) : null} + ) : null} +
); diff --git a/frontend/components/common/Navbar.tsx b/frontend/components/common/Navbar.tsx index 0cefa9e..28c77fb 100644 --- a/frontend/components/common/Navbar.tsx +++ b/frontend/components/common/Navbar.tsx @@ -5,7 +5,7 @@ import { useNear } from '../../hooks/useNear'; import useUser from '../../hooks/useUser'; import LogOutIcon from '../icons/LogOutIcon'; import Token from '../../models/Token'; -import { initContract } from '../near/near'; +// export default function Navbar() { const router = useRouter(); @@ -27,7 +27,7 @@ export default function Navbar() { const logOut = async () => { await setUser(''); - router.push('/') + router.push('/'); await nearContext.walletConnection.signOut(); }; @@ -38,7 +38,7 @@ export default function Navbar() { }; return ( -
+
logo diff --git a/frontend/styles/globals.css b/frontend/styles/globals.css index 9688ee2..397f6b7 100644 --- a/frontend/styles/globals.css +++ b/frontend/styles/globals.css @@ -28,8 +28,8 @@ a { } .menu-btn__burger { - width: 40px; - height: 4px; + width: 25px; + height: 2px; background: #473EA8; border-radius: 5px; box-shadow: 0 2px 5px rgba(20, 6, 1, 0.2); @@ -39,8 +39,8 @@ a { .menu-btn__burger::before, .menu-btn__burger::after { content:''; position: absolute; - width: 40px; - height: 4px; + width: 25px; + height: 2px; background: #473EA8; border-radius: 5px; box-shadow: 0 2px 5px rgba(20, 6, 1, 0.2); @@ -48,11 +48,11 @@ a { } .menu-btn__burger::before { - transform: translateY(-16px); + transform: translateY(-9px); } .menu-btn__burger::after { - transform: translateY(16px); + transform: translateY(9px); } /* Animation */