Skip to content

Commit 6a77973

Browse files
authored
Merge pull request #26 from rickknowlton/main
tweak: changed previous versions of TenK -> TENK
2 parents 2a93333 + f7b787b commit 6a77973

File tree

6 files changed

+20
-19
lines changed

6 files changed

+20
-19
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# TenK NFT Launch Landing Page Template
1+
# TENK NFT Launch Landing Page Template
22

3-
Welcome to your new TenK NFT Launch Landing Page! This codebase gives you everything you need to make a simple-but-powerful landing page for your NFT project with near-zero custom code. Out-of-the-box, you get:
3+
Welcome to your new TENK NFT Launch Landing Page! This codebase gives you everything you need to make a simple-but-powerful landing page for your NFT project with near-zero custom code. Out-of-the-box, you get:
44

55
* Super fast page loads using a Static Site Generator called [Gatsby].
6-
* Internationalization: offer your website in multiple languages for the global NFT market. If you need help translating your page, contact [the TenK team][TenK].
6+
* Internationalization: offer your website in multiple languages for the global NFT market. If you need help translating your page, contact [the TENK DAO team][TENK DAO].
77
* Good SEO and social media sharing support.
88
* Simple customization via the handful of files in the [`config`](./config/) folder.
99

1010
If you need even more customization, you can rest easy knowing that the whole site uses fully-typed TypeScript and a well-considered React architecture with few extensions or add-ons.
1111

1212
[Gatsby]: https://www.gatsbyjs.com
13-
[TenK]: https://tenkbay.com/
13+
[TENK DAO]: https://tenkbay.com/
1414

1515
# Run it
1616

@@ -56,7 +56,7 @@ This last one is interesting. Reading through it, you'll see that it creates a n
5656

5757
The contents of this last file almost look too simple! The import statements take up about as many lines as the main export. At this point you're about ready to go explore the code directly, option-clicking into various files to figure out what they do. Before you do, it's worth knowing about just a few more interesting bits:
5858

59-
* [`src/near`](./src/near/) contains NEAR bootstrapping logic and a TypeScript wrapper around the TenK smart contract. This is amazing! This means you can use TypeScript-powered type-ahead to see what methods are available on your contract as you write your frontend code. If you want to test certain UI states that rely on certain data being returned from your contract, you can return spoof data in `src/near/contracts/tenk.ts` (just remember to change it back without committing it to git!)
60-
* [`src/hooks/useTenk.ts`](./src/hooks/useTenk.ts) contains a [custom React hook](https://reactjs.org/docs/hooks-custom.html) that makes RPC calls to your TenK smart contract once at page load. All React components that use this hook then make use of this data, without requiring new RPC calls.
59+
* [`src/near`](./src/near/) contains NEAR bootstrapping logic and a TypeScript wrapper around the TENK smart contract. This is amazing! This means you can use TypeScript-powered type-ahead to see what methods are available on your contract as you write your frontend code. If you want to test certain UI states that rely on certain data being returned from your contract, you can return spoof data in `src/near/contracts/tenk.ts` (just remember to change it back without committing it to git!)
60+
* [`src/hooks/useTenk.ts`](./src/hooks/useTenk.ts) contains a [custom React hook](https://reactjs.org/docs/hooks-custom.html) that makes RPC calls to your TENK smart contract once at page load. All React components that use this hook then make use of this data, without requiring new RPC calls.
6161
* [`src/hooks/useLocales.ts`](./src/hooks/useLocales.ts) is another custom hook that wraps the complex Gatsby logic needed to use your internationalization data in files outside of `[locale].tsx`. Gatsby forces all data, even simple JSON files, through a Rube Goldberg-like GraphQL pipeline ([GraphQL](https://graphql.org/) is great; Gatsby's overuse of it is tiring). Luckily, this project has automatic TypeScript typing on these GraphQL queries, improving the situation slightly. Note that the locales returned by `useLocales` differ slightly from the ones passed to `[locale].tsx`: they **do not contain `hero` or `extraSections` fields**. (This is due to a limitation of the `gatsby-transformer-json` plugin, which expects all JSON files to have exactly matching fields, while the locale format used by this project is more flexible.)
6262
* [`src/pages/index.tsx`](./src/pages/index.tsx) is the index page of the site. You'll see that it just lists all available locales, and then uses the [`useEffect` React hook](https://reactjs.org/docs/hooks-effect.html) to automatically redirect users to their current locale, if found.

config/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"author": "@TenKBay",
2+
"author": "@TenkDAO",
33
"siteUrl": "https://tenk-dao.github.io/frontend-starter",
44
"contractName": "v2.tenk.testnet",
55
"image": "tenk-logo.png",
@@ -10,7 +10,7 @@
1010
"alt": "Discord"
1111
},
1212
{
13-
"href": "https://twitter.com/TenKBay",
13+
"href": "https://twitter.com/TenkDAO",
1414
"img": "twitter.svg",
1515
"alt": "Twitter"
1616
}

lib/locales/runtimeUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Gas, NEAR } from 'near-units'
22
import { atcb_action as addToCalendar } from 'add-to-calendar-button'
33
import settings from '../../config/settings.json'
44
import { signIn } from '../../src/near'
5-
import { TenK } from '../../src/near/contracts'
5+
import { TENK } from '../../src/near/contracts'
66
import { TenkData } from "../../src/hooks/useTenk"
77
import { saleStatuses, userStatuses } from './Locale'
88
import { Locale } from '../../src/hooks/useLocales'
@@ -118,7 +118,7 @@ const actions = {
118118
trigger: 'click',
119119
}),
120120
'SIGN_IN': signIn,
121-
'MINT': (d: Data) => TenK.nft_mint_many({ num: d.numberToMint ?? 1 }, {
121+
'MINT': (d: Data) => TENK.nft_mint_many({ num: d.numberToMint ?? 1 }, {
122122
gas: Gas.parse('40 Tgas').mul(Gas.from('' + d.numberToMint)),
123123
attachedDeposit: NEAR.from(d.saleInfo.price).mul(NEAR.from('' + d.numberToMint)),
124124
}),

src/components/my-nfts/my-nfts.module.css.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ export const close: string;
44
export const grid: string;
55
export const nft: string;
66
export const highlight: string;
7+
export const chip: string;

src/hooks/useTenk.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react"
22
import { NftContractMetadata, SaleInfo, Token as RawToken } from "../near/contracts/tenk"
3-
import { TenK } from "../near/contracts"
3+
import { TENK } from "../near/contracts"
44
import { wallet } from "../near"
55
import staleData from "../../stale-data-from-build-time.json"
66

@@ -27,13 +27,13 @@ interface ReturnedData extends TenkData {
2727
// initialize calls at root of file so that first evaluation of this file causes
2828
// calls to start, and subsequent imports of this file just use those same calls
2929
const rpcCalls = Promise.all([
30-
TenK.get_sale_info(),
31-
TenK.nft_metadata(),
32-
TenK.tokens_left(),
33-
!account_id ? undefined : TenK.whitelisted({ account_id }),
34-
!account_id ? undefined : TenK.remaining_allowance({ account_id }),
35-
!account_id ? undefined : TenK.nft_tokens_for_owner({ account_id }),
36-
!account_id ? undefined : TenK.mint_rate_limit({ account_id }),
30+
TENK.get_sale_info(),
31+
TENK.nft_metadata(),
32+
TENK.tokens_left(),
33+
!account_id ? undefined : TENK.whitelisted({ account_id }),
34+
!account_id ? undefined : TENK.remaining_allowance({ account_id }),
35+
!account_id ? undefined : TENK.nft_tokens_for_owner({ account_id }),
36+
!account_id ? undefined : TENK.mint_rate_limit({ account_id }),
3737
])
3838

3939
// Export utility to get data in object form, rather than array form.

src/near/contracts/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import settings from "../../../config/settings.json"
22
import { wallet } from ".."
33
import { Contract } from "./tenk"
44

5-
export const TenK = new Contract(wallet.account(), settings.contractName)
5+
export const TENK = new Contract(wallet.account(), settings.contractName)

0 commit comments

Comments
 (0)