diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json new file mode 100644 index 0000000..bffb357 --- /dev/null +++ b/frontend/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/frontend/.gitignore b/frontend/.gitignore deleted file mode 100644 index 6593fdc..0000000 --- a/frontend/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -**/node_modules -**/.next \ No newline at end of file diff --git a/frontend/README.md b/frontend/README.md index 0dc9ea2..9d93bae 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -20,7 +20,16 @@ You can start editing the page by modifying `app/page.js`. The page auto-updates This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. -## Learn More +## Learn More about NEAR + +To learn more about NEAR, take a look at the following resources: + +- [NEAR Documentation](https://docs.near.org) - learn about NEAR. +- [Frontend Docs](https://docs.near.org/build/web3-apps/quickstart) - learn about this example. + +You can check out [the NEAR repository](https://github.com/near) - your feedback and contributions are welcome! + +## Learn More about Next.js To learn more about Next.js, take a look at the following resources: diff --git a/frontend/next.config.js b/frontend/next.config.js index 5fd39aa..25f7984 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -5,10 +5,10 @@ const nextConfig = { images: { unoptimized: true, }, - basePath: isProduction? '/hello-near-examples' : '', + basePath: isProduction ? '/hello-near-examples' : '', output: "export", distDir: 'build', reactStrictMode: true, } -module.exports = nextConfig; +module.exports = nextConfig; \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index 42303bb..9ed3535 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -16,29 +16,18 @@ "@near-wallet-selector/here-wallet": "^8.9.7", "@near-wallet-selector/modal-ui": "^8.9.7", "@near-wallet-selector/my-near-wallet": "^8.9.7", - "@web3-onboard/core": "^2.21.5", - "@web3-onboard/injected-wallets": "^2.10.15", - "@web3-onboard/ledger": "^2.6.0", - "@web3-onboard/react": "^2.8.16", - "@web3-onboard/walletconnect": "^2.5.4", - "base64-js": "^1.5.1", - "ieee754": "^1.2.1", + "bootstrap": "^5", + "bootstrap-icons": "^1.11.3", "near-api-js": "^3.0.4", - "near-social-vm": "github:gagdiez/VM" , - "next": "14.2.0", - "pino-pretty": "^11.0.0", - "react": "^18.2.0", - "react-bootstrap": "^2.10.2", - "react-bootstrap-icons": "^1.11.4", - "react-dom": "^18.2.0", - "react-singleton-hook": "^4.0.1", - "zustand": "^4.5.2" + "next": "14.2.3", + "react": "^18", + "react-dom": "^18" }, "overrides": { "near-api-js": "^3.0.4" }, "devDependencies": { - "eslint": "^8.57.0", - "eslint-config-next": "14.2.2" + "eslint": "^8", + "eslint-config-next": "14.2.3" } } diff --git a/frontend/src/components/cards.js b/frontend/src/components/cards.js index d1f48c2..604a493 100644 --- a/frontend/src/components/cards.js +++ b/frontend/src/components/cards.js @@ -1,45 +1,32 @@ -import Link from "next/link"; +import Link from 'next/link'; -import styles from "../styles/app.module.css"; +import styles from '@/styles/app.module.css'; -export const DocsCard = () => { +export const Cards = () => { return ( - -

- Near Docs -> -

-

Learn how this application works, and what you can build on Near.

- - ); -}; +
+ +

+ Near Docs -> +

+

Learn how this application works, and what you can build on Near.

+ -export const HelloNearCard = () => { - return ( - -

- Near Integration -> -

-

Discover how simple it is to interact with a Near smart contract.

- - ); -}; - -export const HelloComponentsCard = () => { - return ( - -

- Web3 Components -> -

-

See how Web3 components can help you to create multi-chain apps.

- + +

+ Near Integration -> +

+

Discover how simple it is to interact with a Near smart contract.

+ +
); -}; +}; \ No newline at end of file diff --git a/frontend/src/components/navigation.js b/frontend/src/components/navigation.js index c6ee40a..6849b8b 100644 --- a/frontend/src/components/navigation.js +++ b/frontend/src/components/navigation.js @@ -1,12 +1,12 @@ import Image from 'next/image'; import Link from 'next/link'; -import { useEffect, useState } from 'react'; +import { useEffect, useState, useContext } from 'react'; -import Logo from '/public/near-logo.svg' -import { useStore } from '@/layout'; +import { NearContext } from '@/context'; +import NearLogo from '/public/near-logo.svg'; export const Navigation = () => { - const { signedAccountId, wallet } = useStore(); + const { signedAccountId, wallet } = useContext(NearContext); const [action, setAction] = useState(() => { }); const [label, setLabel] = useState('Loading...'); @@ -20,13 +20,13 @@ export const Navigation = () => { setAction(() => wallet.signIn); setLabel('Login'); } - }, [signedAccountId, wallet, setAction, setLabel]); + }, [signedAccountId, wallet]); return (