-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add structure + some common libs + ide config
- Loading branch information
Tien Nam Dao
committed
Sep 20, 2022
1 parent
f28d4ed
commit 4771c51
Showing
17 changed files
with
274 additions
and
2,387 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,9 @@ | ||
cypress | ||
cypress.json | ||
.github | ||
.husky | ||
.next | ||
doc | ||
node_modules | ||
scripts | ||
README.md |
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,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
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 @@ | ||
{ | ||
"arrowParens": "avoid", | ||
"bracketSpacing": true, | ||
"printWidth": 120, | ||
"singleQuote": true, | ||
"jsxBracketSameLine": false, | ||
"semi": false, | ||
"quoteProps": "consistent", | ||
"useTabs": true, | ||
"tabWidth": 4, | ||
"trailingComma": "none" | ||
} |
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,43 @@ | ||
# Install dependencies only when needed | ||
FROM node:18-alpine AS deps | ||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | ||
WORKDIR /app | ||
COPY package.json yarn.lock ./ | ||
COPY . . | ||
RUN yarn --frozen-lockfile | ||
|
||
|
||
# Rebuild the source code only when needed | ||
FROM node:18-alpine AS builder | ||
WORKDIR /app | ||
COPY --from=deps /app/node_modules ./node_modules | ||
COPY --from=deps /app/src ./src | ||
COPY . . | ||
RUN yarn build | ||
|
||
# Production image, copy all the files and run next | ||
FROM node:18-alpine AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV production | ||
# Uncomment the following line in case you want to disable telemetry during runtime. | ||
# ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
|
||
# You only need to copy next.config.js if you are NOT using the default configuration | ||
COPY --from=builder /app/next.config.js ./ | ||
COPY --from=builder /app/public ./public | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package.json ./package.json | ||
|
||
# Automatically leverage output traces to reduce image size | ||
# https://nextjs.org/docs/advanced-features/output-file-tracing | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/ ./.next/ | ||
|
||
USER nextjs | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["yarn", "start"] |
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,56 @@ | ||
import React from "react"; | ||
import Link from "next/link"; | ||
import { useRouter } from "next/router"; | ||
|
||
const Header: React.FC = () => { | ||
const router = useRouter(); | ||
const isActive: (pathname: string) => boolean = (pathname) => | ||
router.pathname === pathname; | ||
|
||
let left = ( | ||
<div className="left"> | ||
<Link href="/"> | ||
<a className="bold" data-active={isActive("/")}> | ||
Feed | ||
</a> | ||
</Link> | ||
<style jsx>{` | ||
.bold { | ||
font-weight: bold; | ||
} | ||
a { | ||
text-decoration: none; | ||
color: #000; | ||
display: inline-block; | ||
} | ||
.left a[data-active="true"] { | ||
color: gray; | ||
} | ||
a + a { | ||
margin-left: 1rem; | ||
} | ||
`}</style> | ||
</div> | ||
); | ||
|
||
let right = null; | ||
|
||
return ( | ||
<nav> | ||
{left} | ||
{right} | ||
<style jsx>{` | ||
nav { | ||
display: flex; | ||
padding: 2rem; | ||
align-items: center; | ||
} | ||
`}</style> | ||
</nav> | ||
); | ||
}; | ||
|
||
export default Header; |
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,16 @@ | ||
version: '3.9' | ||
|
||
services: | ||
vesting: | ||
image: explorer-fe | ||
ports: | ||
- '80:3000' | ||
environment: | ||
- NEXT_PUBLIC_ENDPOINT='http://159.223.36.174:1317' | ||
- NEXT_PUBLIC_RPC='http://167.71.207.84:8545' | ||
- NEXT_PUBLIC_CHAINID=11115 | ||
- NEXT_PUBLIC_COSMOS_CHAINID='astra_11115-1' | ||
restart: unless-stopped | ||
logging: | ||
options: | ||
max-size: 10m |
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,6 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
} | ||
|
||
module.exports = nextConfig |
Oops, something went wrong.