Skip to content

Commit

Permalink
feat(nfts): add initial snaefell-ui implementation (#17223)
Browse files Browse the repository at this point in the history
Co-authored-by: bearni95 <[email protected]>
  • Loading branch information
bearni95 and bearni95 authored May 23, 2024
1 parent dbed99a commit 52a6fe1
Show file tree
Hide file tree
Showing 283 changed files with 361,582 additions and 9 deletions.
4 changes: 3 additions & 1 deletion packages/snaefell-ui/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
BAR=FOO
PUBLIC_WALLETCONNECT_PROJECT_ID=fake
PUBLIC_IPFS_GATEWAY=https://taikoons.4everland.link/ipfs/
PUBLIC_LAUNCH_DATE=2024-05-26T00:00:00
20 changes: 20 additions & 0 deletions packages/snaefell-ui/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.DS_Store
node_modules
coverage
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Generated files
/src/abi/*
CHANGELOG.md

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

src/generated/*
49 changes: 49 additions & 0 deletions packages/snaefell-ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'simple-import-sort'],
rules: {
'linebreak-style': ['error', 'unix'],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-irregular-whitespace': 'off'
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte'],
},
env: {
browser: true,
es2017: true,
node: true,
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
},
{
files: ['*.ts', '*.svelte'],
rules: {
// TS will take care of this potential error. For more information please visit:
// https://typescript-eslint.io/linting/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
'no-undef': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',


},
},
],
}
10 changes: 10 additions & 0 deletions packages/snaefell-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
4 changes: 4 additions & 0 deletions packages/snaefell-ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
18 changes: 18 additions & 0 deletions packages/snaefell-ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"semi": true,
"tabWidth": 2,
"useTabs": false,
"printWidth": 120,
"singleQuote": true,
"trailingComma": "all",
"bracketSameLine": true,
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
16 changes: 16 additions & 0 deletions packages/snaefell-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

## 1.0.0 (2024-05-15)


### Features

* **taikoon:** devnet deployment ([#16937](https://github.com/taikoxyz/taiko-mono/issues/16937)) ([387ffb1](https://github.com/taikoxyz/taiko-mono/commit/387ffb1d18423f9e52dd9f668ddfaef748f7c97f))
* **taikoon:** taikoon ui setup ([#16854](https://github.com/taikoxyz/taiko-mono/issues/16854)) ([0ba891a](https://github.com/taikoxyz/taiko-mono/commit/0ba891a11f84d5a612dda10c5074d402cffd4100))
* **taikoon:** ui qa checklist ([#16870](https://github.com/taikoxyz/taiko-mono/issues/16870)) ([e965597](https://github.com/taikoxyz/taiko-mono/commit/e96559762d844b042bbf23de878883d3b647671a))
* **taikoon:** ui qa checklist ([#17175](https://github.com/taikoxyz/taiko-mono/issues/17175)) ([924adf3](https://github.com/taikoxyz/taiko-mono/commit/924adf3df2db4d4bee9a2af912705aea5dbc3659))


### Reverts

* **repo:** ui qa checklist ([#17174](https://github.com/taikoxyz/taiko-mono/issues/17174)) ([43cb9a2](https://github.com/taikoxyz/taiko-mono/commit/43cb9a2f82ae808fde282154cded508b52dd76b3))
58 changes: 58 additions & 0 deletions packages/snaefell-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Frontend

## Install

```bash
npm install
```

## Run

Start the development server:

```bash
npm start
```

## Storybook

Tool to develop UI components in isolation. Run the following command to start the storybook server:

```bash
npm run storybook
```

---

## Status Tracker

### Pages

| Page | Status | Notes |
| ------------- | ------ | ----- |
| Countdown | | |
| Landing | | |
| Mint | | |
| Auction | | |
| Explore | | |
| Your Taikoons | | |

### Components

| Component | Status | Notes |
| -------------- | --------------------- | ----- |
| Header | | |
| Countdown | | |
| NFT Renderer | | |
| Background | | |
| Landing Header | Design Ready | |
| Landing Text | Design Ready | |
| Landing FAQ | Design Ready | |
| Landing Links | Design Ready | |
| Footer | Design Ready | |
| Mint Form | Design Ready | |
| Auction Form | Design Ready | |
| Card | In Storybook | |
| Button | In Storybook | |
| Text Input | Implemented on Weblab | |
| Spinner | In Storybook |
74 changes: 67 additions & 7 deletions packages/snaefell-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,72 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "echo 'Unimplemented'",
"check": "echo 'Unimplemented'",
"lint": "echo 'Unimplemented'",
"test:unit": "echo 'Unimplemented'"
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"test": "npm run test:integration && npm run test:unit",
"svelte:check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check": "npm run svelte:check",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check ./src && eslint ./src --fix",
"format": "prettier --write ./src",
"test:integration": "playwright test",
"test:unit": "vitest",
"start": "npm run generate:abi && vite dev --open",
"generate:abi": "cd ../nfts && pnpm compile && cd - && wagmi generate"
},
"author": "",
"license": "ISC"
"devDependencies": {
"@chromatic-com/storybook": "^1.3.1",
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "^8.56.0",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.7",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"convert-csv-to-json": "^2.44.0",
"dotenv": "^16.4.5",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-svelte": "^2.38.0",
"p-map": "^7.0.2",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"raw-body": "^2.5.2",
"svelte": "^4.2.7",
"svelte-check": "^3.7.1",
"svelte-copy": "^1.4.2",
"svelte-i18n": "^4.0.0",
"svelte-scrolling": "^1.4.0",
"tailwindcss-image-rendering": "^1.0.2",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.3",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.2.0",
"which": "^4.0.0"
},
"type": "module",
"dependencies": {
"@openzeppelin/merkle-tree": "^1.0.6",
"@wagmi/cli": "^2.1.4",
"@wagmi/connectors": "^4.1.18",
"@wagmi/core": "^2.8.0",
"@web3modal/common": "^4.1.1",
"@web3modal/ui": "^4.1.1",
"@web3modal/wagmi": "^4.1.1",
"@zerodevx/svelte-toast": "^0.9.5",
"autoprefixer": "^10.4.19",
"daisyui": "^4.10.1",
"dayjs": "^1.11.10",
"debug": "^4.3.4",
"minidenticons": "^4.2.1",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"viem": "^2.9.29"
}
}
12 changes: 12 additions & 0 deletions packages/snaefell-ui/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { PlaywrightTestConfig } from '@playwright/test'

const config: PlaywrightTestConfig = {
webServer: {
command: 'npm run build && npm run preview',
port: 4173,
},
testDir: 'tests',
testMatch: /(.+\.)?(test|spec)\.[jt]s/,
}

export default config
6 changes: 6 additions & 0 deletions packages/snaefell-ui/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
62 changes: 62 additions & 0 deletions packages/snaefell-ui/src/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
export const recommendedProcessingFee = {
ethGasLimit: BigInt(900_000),
erc20NotDeployedGasLimit: BigInt(3_100_000),
erc20DeployedGasLimit: BigInt(1_100_000),
erc721NotDeployedGasLimit: BigInt(2_400_000),
erc721DeployedGasLimit: BigInt(1_100_000),
erc1155NotDeployedGasLimit: BigInt(2_600_000),
erc1155DeployedGasLimit: BigInt(1_100_000),
};

export const processingFeeComponent = {
closingDelayOptionClick: 300,
intervalComputeRecommendedFee: 20_000,
};

export const bridgeService = {
noOwnerGasLimit: BigInt(140_000),
noERC20TokenDeployedGasLimit: BigInt(3_000_000),
erc20GasLimitThreshold: BigInt(2_500_000),

noERC721TokenDeployedGasLimit: BigInt(2_400_000),
erc721GasLimitThreshold: BigInt(3_000_000),

noERC1155TokenDeployedGasLimit: BigInt(2_600_000),
erc1155GasLimitThreshold: BigInt(3_000_000),
};

export const pendingTransaction = {
waitTimeout: 300_000,
};

export const storageService = {
bridgeTxPrefix: 'transactions',
customTokenPrefix: 'custom-tokens',
};

export const bridgeTransactionPoller = {
interval: 20_000,
};

export const statusComponent = {
minimumEthToClaim: 0.0001,
};

export const transactionConfig = {
pageSizeDesktop: 6,
pageSizeMobile: 5,
blurTransitionTime: 300,
};

export const toastConfig = {
duration: 5000,
};

export const apiService = {
timeout: 5000,
};

export const ipfsConfig = {
gatewayTimeout: 200,
overallTimeout: 5000,
};
Loading

0 comments on commit 52a6fe1

Please sign in to comment.