Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
elicharlese committed May 10, 2024
1 parent f175e56 commit 39df2ae
Show file tree
Hide file tree
Showing 47 changed files with 619 additions and 116 deletions.
23 changes: 23 additions & 0 deletions app/ThemeProvider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// React
import React, { createContext, useState, useContext } from 'react';

// Create a context for the theme
const ThemeContext = createContext();

// Create a provider that will hold the state and enable it to be modified
export const ThemeProvider = ({ children }) => {
const [theme, setTheme] = useState('light');

const toggleTheme = () => {
setTheme((prevTheme) => (prevTheme === 'light' ? 'dark' : 'light'));
};

return (
<ThemeContext.Provider value={{ theme, toggleTheme }}>
{children}
</ThemeContext.Provider>
);
};

// Create a custom hook that will allow our components to easily access and modify the theme
export const useTheme = () => useContext(ThemeContext);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions app/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export const NetworkId = 'testnet';

export const HelloNearContract = {
mainnet: 'hello.near-examples.near',
testnet: 'hello.near-examples.testnet',
}

export const ComponentMap = {
mainnet: {
socialDB: 'social.near',
Lido: 'zavodil.near/widget/Lido',
HelloNear: 'gagdiez.near/widget/HelloNear',
LoveNear: 'gagdiez.near/widget/LoveNear',
},
testnet: {
socialDB: 'v1.social08.testnet',
Lido: 'influencer.testnet/widget/Lido',
HelloNear: 'influencer.testnet/widget/HelloNear',
LoveNear: 'influencer.testnet/widget/LoveNear',
}
}
23 changes: 23 additions & 0 deletions app/context/ThemeProvider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// React
import React, { createContext, useState, useContext } from 'react';

// Create a context for the theme
const ThemeContext = createContext();

// Create a provider that will hold the state and enable it to be modified
export const ThemeProvider = ({ children }) => {
const [theme, setTheme] = useState('light');

const toggleTheme = () => {
setTheme((prevTheme) => (prevTheme === 'light' ? 'dark' : 'light'));
};

return (
<ThemeContext.Provider value={{ theme, toggleTheme }}>
{children}
</ThemeContext.Provider>
);
};

// Create a custom hook that will allow our components to easily access and modify the theme
export const useTheme = () => useContext(ThemeContext);
46 changes: 46 additions & 0 deletions app/frontend/cards.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import styles from '../contracts/app.module.css';

export const DocsCard = () => {
return (
<a
href="https://docs.near.org/develop/integrate/quickstart-frontend"
className={styles.card}
target='_blank'
rel="noopener noreferrer"
>
<h2>
Near Docs <span>-&gt;</span>
</h2>
<p>Learn how this application works, and what you can build on Near.</p>
</a>);
};

export const HelloNearCard = () => {
return (
<a
href="/hello-near"
className={styles.card}
rel="noopener noreferrer"
>
<h2>
Near Integration <span>-&gt;</span>
</h2>
<p>Discover how simple it is to interact with a Near smart contract.</p>
</a>
);
};

export const HelloComponentsCard = () => {
return (
<a
href="/hello-components"
className={styles.card}
rel="noopener noreferrer"
>
<h2>
Web3 Components <span>-&gt;</span>
</h2>
<p>See how Web3 components can help you to create multi-chain apps.</p>
</a>
);
};
112 changes: 0 additions & 112 deletions app/frontend/components/Contribute.tsx

This file was deleted.

Empty file.
Empty file.
Empty file.
6 changes: 2 additions & 4 deletions app/frontend/layouts/NormalMode.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React from 'react';
import NormalModeHome from './../components/NormalMode/NormalModeHome';
import NormalModeMarketplaceProductPage from './../components/NormalMode/NormalModeMarketplaceProductPage';

export const NormalMode = () => {
return (
<div>
<NormalModeHome />
<NormalModeMarketplaceProductPage />
<Marketplace />
<
</div>
)
}
36 changes: 36 additions & 0 deletions app/frontend/navigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Image from 'next/image';
import Link from 'next/link';
import { useEffect, useState } from 'react';

import NearLogo from 'public/near-logo.svg';
import { useWallet } from '../wallets/wallet-selector';

export const Navigation = () => {

const { signedAccountId, logOut, logIn } = useWallet();
const [action, setAction] = useState(() => { });
const [label, setLabel] = useState('Loading...');

useEffect(() => {
if (signedAccountId) {
setAction(() => logOut);
setLabel(`Logout ${signedAccountId}`);
} else {
setAction(() => logIn);
setLabel('Login');
}
}, [signedAccountId, logOut, logIn, setAction, setLabel]);

return (
<nav className="navbar navbar-expand-lg">
<div className="container-fluid">
<Link href="/" passHref legacyBehavior>
<Image priority src={NearLogo} alt="NEAR" width="30" height="24" className="d-inline-block align-text-top" />
</Link>
<div className='navbar-nav pt-1'>
<button className="btn btn-secondary" onClick={action} > {label} </button>
</div>
</div>
</nav>
);
};
Empty file.
Empty file.
Loading

0 comments on commit 39df2ae

Please sign in to comment.