Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
polarker committed Oct 16, 2024
1 parent 1dae1e0 commit 867f30e
Show file tree
Hide file tree
Showing 10 changed files with 2,738 additions and 10,676 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Alephium Next.js Template

This is a Alephium template project for the [Next.js](https://nextjs.org/) framework.
This is a Alephium template project for [Next.js](https://nextjs.org/) app router.

This template project demonstrates how to implement a simple token
faucet and expose it with a Web UI using Next.js.
Expand Down
13,292 changes: 2,661 additions & 10,631 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@
"dependencies": {
"@alephium/web3": "v1.8.0",
"@alephium/web3-react": "v1.8.0",
"@next/font": "13.1.4",
"detect-browser": "^5.3.0",
"eslint-config-next": "13.1.4",
"framer-motion": "^6.3.11",
"next": "13.1.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"next": "^14.2.15",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-transition-state": "^1.1.4",
"react-use-measure": "^2.1.1",
"resize-observer-polyfill": "^1.5.1",
Expand All @@ -48,9 +47,9 @@
"@alephium/cli": "v1.8.0",
"@alephium/web3-test": "v1.8.0",
"@types/jest": "^27.5.1",
"@types/node": "18.11.18",
"@types/react": "18.0.27",
"@types/react-dom": "18.0.10",
"@types/node": "^20.11.18",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@types/styled-components": "^5.1.25",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
Expand All @@ -63,7 +62,7 @@
"typescript": "^4.4.2"
},
"engines": {
"node": ">=14.0.0 <17.0.0",
"npm": ">=7.0.0"
"node": ">=18.0.0",
"npm": ">=10.0.0"
}
}
29 changes: 29 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import '@/styles/globals.css'

import { tokenFaucetConfig } from '@/services/utils';
import { AlephiumWalletProvider } from '@alephium/web3-react';
import React from 'react';

export const metadata = {
title: "Alephium dApp Template",
description: "A template for building dApps on Alephium",
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<head>
<link rel="icon" href="/favicon.ico" />
</head>
<body>
<AlephiumWalletProvider theme="web95" network={tokenFaucetConfig.network} addressGroup={tokenFaucetConfig.groupIndex}>
{children}
</AlephiumWalletProvider>
</body>
</html>
);
}
10 changes: 10 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import Home from '@/components/Home';

export default function HomePage() {
return (
<>
<Home />
</>
)
}
4 changes: 3 additions & 1 deletion src/pages/index.tsx → src/components/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
'use client'

import React from 'react'
import Head from 'next/head'
import styles from '@/styles/Home.module.css'
import { TokenDapp } from '@/components/TokenDapp'
import { TokenDapp } from './TokenDapp'
import { AlephiumConnectButton, useWallet } from '@alephium/web3-react'
import { tokenFaucetConfig } from '@/services/utils'

Expand Down
4 changes: 3 additions & 1 deletion src/components/TokenDapp.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
'use client'

import React, { useCallback } from 'react'
import { FC, useState } from 'react'
import styles from '../styles/Home.module.css'
import { withdrawToken } from '@/services/token.service'
import { TxStatus } from './TxStatus'
import { useWallet } from '@alephium/web3-react'
import { node } from "@alephium/web3"
import { node } from '@alephium/web3'
import { TokenFaucetConfig } from '@/services/utils'

export const TokenDapp: FC<{
Expand Down
14 changes: 0 additions & 14 deletions src/pages/_app.tsx

This file was deleted.

14 changes: 0 additions & 14 deletions src/pages/_document.tsx

This file was deleted.

28 changes: 23 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand All @@ -16,9 +20,23 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
"@/*": [
"./src/*"
]
},
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}

0 comments on commit 867f30e

Please sign in to comment.