-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97c17bc
commit 26ad3f1
Showing
22 changed files
with
4,828 additions
and
508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"bracketSpacing": true, | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"bracketSameLine": false, | ||
"endOfLine": "lf", | ||
"semi": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"locales": ["en", "ja"], | ||
"defaultLocale": "ja", | ||
"pages": { | ||
"*": ["common"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"layout": { | ||
"nav": { | ||
"HEADING": "Learn To Earn", | ||
"HOME": "Home", | ||
"QUESTS": "Quests", | ||
"ADMIN": "Admin", | ||
"WALLET__NOT_CONNECTED": "Wallet Not Connected", | ||
"WALLET__SETTINGS": "Settings" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"layout": { | ||
"nav": { | ||
"HEADING": "稼ぐことを学ぶ", | ||
"HOME": "ホーム", | ||
"QUESTS": "クエスト", | ||
"ADMIN": "管理者", | ||
"WALLET__NOT_CONNECTED": "ウォレットが接続されていない", | ||
"WALLET__SETTINGS": "設定" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
const nextTranslate = require('next-translate-plugin'); | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
module.exports = nextTranslate({ | ||
reactStrictMode: true, | ||
} | ||
|
||
module.exports = nextConfig | ||
trailingSlash: true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {Container} from "@chakra-ui/react"; | ||
|
||
const Footer = ()=>{ | ||
return( | ||
<Container> | ||
Footer | ||
</Container> | ||
) | ||
} | ||
export default Footer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import { | ||
Heading, | ||
Box, | ||
Link, | ||
Flex, | ||
Spacer, | ||
useColorMode, | ||
Button, | ||
Menu, | ||
MenuButton, | ||
MenuList, | ||
MenuItem, | ||
Stack, | ||
} from '@chakra-ui/react'; | ||
import { useRouter } from 'next/router'; | ||
import useTranslation from 'next-translate/useTranslation'; | ||
import { default as NextLink } from 'next/link'; | ||
import { MoonIcon, SunIcon, ChevronDownIcon } from '@chakra-ui/icons'; | ||
import setLanguage from 'next-translate/setLanguage'; | ||
import Footer from '@/components/Footer'; | ||
import Head from 'next/head'; | ||
import styles from '@/styles/Home.module.css'; | ||
// import {Profile} from '@/components/wallet/profile'; | ||
import { useAccount, useNetwork } from 'wagmi'; | ||
import { avalancheFuji } from 'wagmi/chains'; | ||
|
||
interface LayoutProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
const Layout = ({ children }: LayoutProps) => { | ||
const { address, connector, isConnected } = useAccount(); | ||
const { chain } = useNetwork(); | ||
const router = useRouter(); | ||
const { t, lang } = useTranslation('common'); | ||
const { colorMode, toggleColorMode } = useColorMode(); | ||
return ( | ||
<> | ||
<Head> | ||
<title>{t('layout.nav.HEADING')}</title> | ||
<meta name='description' content='Generated by create next app' /> | ||
<meta name='viewport' content='width=device-width, initial-scale=1' /> | ||
<link rel='icon' href='/favicon.ico' /> | ||
</Head> | ||
{/*<SwitchNetworkAlert />*/} | ||
{/*<MetaMaskLeadBanner />*/} | ||
<Box p='4' bg={isConnected ? '#88ff8811' : '#ff888811'}> | ||
<Flex> | ||
<Box p={2}> | ||
<Link as={NextLink} href='/' locale={router.locale}> | ||
<Heading size='md'> | ||
<pre>{t('layout.nav.HEADING')}</pre> | ||
</Heading> | ||
</Link> | ||
</Box> | ||
<Spacer /> | ||
<Stack alignItems={'center'} direction='row' spacing={4}> | ||
<Link as={NextLink} _focus={{ boxShadow: 'none' }} href='/' p={4}> | ||
{t('layout.nav.HOME')} | ||
</Link> | ||
<Link as={NextLink} href={'/quests'} _focus={{ boxShadow: 'none' }} p={4}> | ||
{t('layout.nav.QUESTS')} | ||
</Link> | ||
<Link as={NextLink} href={'/admin'} _focus={{ boxShadow: 'none' }} p={4}> | ||
{t('layout.nav.ADMIN')} | ||
</Link> | ||
<Menu> | ||
<MenuButton | ||
colorScheme={ | ||
isConnected && chain?.id == avalancheFuji.id | ||
? 'green' | ||
: isConnected | ||
? 'orange' | ||
: 'red' | ||
} | ||
as={Button} | ||
rightIcon={<ChevronDownIcon />} | ||
> | ||
{isConnected ? `Connected to ${chain?.name}` : t('layout.nav.WALLET__NOT_CONNECTED')} | ||
{/*{t('TOOL_LINK')}*/} | ||
</MenuButton> | ||
<MenuList> | ||
<MenuItem> | ||
<NextLink href='/wallet'>{t('layout.nav.WALLET__SETTINGS')}</NextLink> | ||
</MenuItem> | ||
{/*<Profile />*/} | ||
{/*<MenuItem>*/} | ||
{/* /!*<Link href="/koukan">*!/*/} | ||
{/* {t('EXCHANGE_LINK')}*/} | ||
{/* /!*</Link>*!/*/} | ||
{/*</MenuItem>*/} | ||
</MenuList> | ||
</Menu> | ||
<Button size='md' onClick={toggleColorMode} p={4}> | ||
{colorMode == 'dark' ? <SunIcon /> : <MoonIcon />} | ||
</Button> | ||
<Button size='md' onClick={async () => await setLanguage(lang == 'en' ? 'ja' : 'en')}> | ||
{lang == 'en' ? '日本' : 'En'} | ||
</Button> | ||
</Stack> | ||
</Flex> | ||
</Box> | ||
<Box p={5}>{children}</Box> | ||
<Footer /> | ||
</> | ||
); | ||
}; | ||
|
||
export default Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {extendTheme, type ThemeConfig} from '@chakra-ui/react' | ||
|
||
const config: ThemeConfig = { | ||
initialColorMode: 'dark', | ||
useSystemColorMode: true | ||
}; | ||
|
||
export const gradationColor = { | ||
styles: { | ||
global: { | ||
body: {}, | ||
html: { | ||
height: '100%' | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export const theme = extendTheme({ | ||
config | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,34 @@ | ||
import '@/styles/globals.css' | ||
import { WagmiConfig, createClient, configureChains } from 'wagmi' | ||
import { ChakraProvider } from '@chakra-ui/react' | ||
import type { AppProps } from 'next/app' | ||
import { theme } from '@/layouts/theme' | ||
import { MetaMaskConnector } from 'wagmi/connectors/metaMask' | ||
import Layout from '@/layouts/Layout' | ||
import { publicProvider } from '@wagmi/core/providers/public' | ||
// import connector from '@/components/metaMask/WagmiMetamask' | ||
import { avalancheFuji } from 'wagmi/chains' | ||
|
||
export default function App({ Component, pageProps }: AppProps) { | ||
return <Component {...pageProps} /> | ||
const { chains, provider } = configureChains( | ||
[avalancheFuji], | ||
[publicProvider()], | ||
) | ||
|
||
const client = createClient({ | ||
autoConnect: true, | ||
connectors: [new MetaMaskConnector({ chains })], | ||
provider, | ||
}) | ||
|
||
function MyApp({ Component, pageProps }: AppProps): JSX.Element { | ||
return ( | ||
<WagmiConfig client={client}> | ||
<ChakraProvider theme={theme}> | ||
<Layout> | ||
<Component {...pageProps} /> | ||
</Layout> | ||
</ChakraProvider> | ||
</WagmiConfig> | ||
) | ||
} | ||
|
||
export default MyApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Container, Grid, GridItem } from '@chakra-ui/react'; | ||
|
||
const Admin = () => { | ||
return ( | ||
<Grid templateColumns='350px 1fr' gap={6} width={"100%"} height={"80vh"}> | ||
<GridItem bg='blue.100' height={'100%'}/> | ||
<GridItem bg='blue.100' height={'100%'}/> | ||
</Grid> | ||
); | ||
}; | ||
export default Admin; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction | ||
import type { NextApiRequest, NextApiResponse } from 'next'; | ||
import { QuestInterface } from '@/types'; | ||
|
||
type Data = { | ||
created_at: Date | ||
expires_at: Date | ||
questions: QuestInterface[] | ||
} | ||
|
||
export default function handler( | ||
req: NextApiRequest, | ||
res: NextApiResponse<Data>, | ||
) { | ||
res.status(200).json({ | ||
created_at: new Date(), | ||
expires_at: new Date(), | ||
questions: [ | ||
{ | ||
question: 'Who Invented Blockchain Technology?', | ||
selection: 'single', | ||
options: ['Satoshi Nakamoto', 'Linus Torvalds', 'Bill Gates', 'Reid Hoffman'], | ||
}, | ||
{ | ||
question: 'What is Pitpa Learn to Earn?', | ||
selection: 'single', | ||
options: ['A Web hosting platform', 'An internet service provider', 'A learning platform', 'An Automated Teller Machine'], | ||
}, | ||
{ | ||
question: 'What can you do earn through Pitpa Learn to Earn?', | ||
selection: 'single', | ||
options: ['Japanese Yen', 'United States Dollars', 'Crypto Currency', 'Nothing'], | ||
}, | ||
], | ||
}); | ||
} |
Oops, something went wrong.