Skip to content

Commit

Permalink
feat(bug): gatsby bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Baraniecki committed Jun 7, 2022
1 parent 44e5cf9 commit 8c03ac2
Show file tree
Hide file tree
Showing 225 changed files with 569 additions and 12,369 deletions.
51 changes: 5 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/26466516/169722691-77a6ca86-df54-4a0e-b952-48c3f3ed7526.png" alt="Gatsby TypeScript Starter">
</p>
## reproducing gatsby bug

<br />
Just run `yarn build`.

<div align="center"><strong>Non-opinionated TypeScript starter for Gatsby</strong></div>
<div align="center">A TypeScript starter for Gatsby. No plugins and styling. Exactly the necessary to start.</div>
The bug was [described on github](https://github.com/gatsbyjs/gatsby/issues/35865).

<br />
...

<div align="center">
<img src="https://img.shields.io/static/v1?label=PRs&message=welcome&style=flat-square&color=5e17eb&labelColor=000000" alt="PRs welcome!" />

<img alt="License" src="https://img.shields.io/github/license/jpedroschmitz/gatsby-starter-ts?style=flat-square&color=5e17eb&labelColor=000000">

<a href="https://twitter.com/intent/follow?screen_name=jpedroschmitz">
<img src="https://img.shields.io/twitter/follow/jpedroschmitz?style=flat-square&color=5e17eb&labelColor=000000" alt="Follow @jpedroschmitz" />
</a>
</div>

<div align="center">
<sub>Created by <a href="https://twitter.com/jpedroschmitz">João Pedro</a> with the help of many <a href="https://github.com/jpedroschmitz/gatsby-starter-ts/graphs/contributors">wonderful contributors</a>.</sub>
</div>

<br />
Created with [gatsby-starter-ts](https://github.com/jpedroschmitz/gatsby-starter-ts)

## Features

Expand All @@ -42,14 +25,6 @@
- ⚙️ EditorConfig - Consistent coding styles across editors and IDEs
- 🗂 Path Mapping — Import components or images using the `@` prefix

## Quick Start

The best way to start with this template is using the [Gatsby CLI](https://www.gatsbyjs.com/docs/reference/gatsby-cli/).

```
npx gatsby new starter-ts https://github.com/jpedroschmitz/gatsby-starter-ts
```

### Development

To start the project locally, run:
Expand Down Expand Up @@ -105,19 +80,3 @@ This starter uses Yarn 1 (Classic) by default, but this choice is yours. If you'
## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for more information.

## TODO

✅ gatsby-node: migrate pages created by a call to `createNonPrismicDependentPageWithLangParam`
✅ gatsby-node: possibly problematic MarketsLearn page
✅ gatsby-node: possibly problematic MarketsLearnDailyAnalysis page
- migrate pages in gatsby-config
✅ fix theming (dark)
✅ check & verify linking & nav between main asset page & news articles
✅ possibly DA pages with JSON over GraphQL
- verify segment is working
- configs & amplify files
- verify build process
- remove commitizen & commitlint?
- write readme
- mobile developers: ask to remove lang param from pages: chsb-yield-terms, privacy, terms, yield-terms
104 changes: 1 addition & 103 deletions common-config.ts
Original file line number Diff line number Diff line change
@@ -1,103 +1 @@
import { Locale } from './src/components/Layout';

export type Analysis = 'full' | 'stablecoin';

export interface AssetConfig {
assetSymbol: string;
analysis: Analysis;
isDeFi: boolean;
isSmartYield: boolean;
}

export const allAssets: AssetConfig[] = [
{ assetSymbol: `aave`, analysis: `full`, isDeFi: true, isSmartYield: false },
{ assetSymbol: `btc`, analysis: `full`, isDeFi: false, isSmartYield: true },
{ assetSymbol: `eth`, analysis: `full`, isDeFi: false, isSmartYield: true },
{ assetSymbol: `chsb`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `enj`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `paxg`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `bch`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `ltc`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `comp`, analysis: `full`, isDeFi: true, isSmartYield: false },
{ assetSymbol: `knc`, analysis: `full`, isDeFi: true, isSmartYield: false },
{ assetSymbol: `ren`, analysis: `full`, isDeFi: true, isSmartYield: false },
{ assetSymbol: `bnb`, analysis: `full`, isDeFi: false, isSmartYield: true },
{
assetSymbol: `usdc`,
analysis: `stablecoin`,
isDeFi: false,
isSmartYield: true,
},
{
assetSymbol: `eurt`,
analysis: `stablecoin`,
isDeFi: false,
isSmartYield: true,
},
{
assetSymbol: `dai`,
analysis: `stablecoin`,
isDeFi: true,
isSmartYield: true,
},
{ assetSymbol: `uni`, analysis: `full`, isDeFi: true, isSmartYield: false },
{ assetSymbol: `utk`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `chz`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `xrp`, analysis: `full`, isDeFi: false, isSmartYield: true },
{
assetSymbol: `usdt`,
analysis: `stablecoin`,
isDeFi: false,
isSmartYield: true,
},
{
assetSymbol: `chainlink`,
analysis: `full`,
isDeFi: true,
isSmartYield: false,
},
{ assetSymbol: `dot`, analysis: `full`, isDeFi: true, isSmartYield: false },
{ assetSymbol: `matic`, analysis: `full`, isDeFi: true, isSmartYield: true },
{ assetSymbol: `ftt`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `crv`, analysis: `full`, isDeFi: true, isSmartYield: false },
{ assetSymbol: `bat`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `grt`, analysis: `full`, isDeFi: true, isSmartYield: false },
{
assetSymbol: `audio`,
analysis: `full`,
isDeFi: false,
isSmartYield: false,
},
{ assetSymbol: `occ`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `uos`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `ghst`, analysis: `full`, isDeFi: false, isSmartYield: true },
{ assetSymbol: `mana`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `sand`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `mimo`, analysis: `full`, isDeFi: true, isSmartYield: false },
{ assetSymbol: `hbar`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `imx`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `lrc`, analysis: `full`, isDeFi: true, isSmartYield: false },
{
assetSymbol: `par`,
analysis: `stablecoin`,
isDeFi: true,
isSmartYield: false,
},
{ assetSymbol: `shib`, analysis: `full`, isDeFi: false, isSmartYield: false },
{
assetSymbol: `ust`,
analysis: `stablecoin`,
isDeFi: true,
isSmartYield: true,
},
{ assetSymbol: `gala`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `sol`, analysis: `full`, isDeFi: true, isSmartYield: false },
{ assetSymbol: `avax`, analysis: `full`, isDeFi: true, isSmartYield: true },
{ assetSymbol: `bnt`, analysis: `full`, isDeFi: true, isSmartYield: true },
{ assetSymbol: `ape`, analysis: `full`, isDeFi: false, isSmartYield: false },
{ assetSymbol: `cake`, analysis: `full`, isDeFi: true, isSmartYield: false },
{ assetSymbol: `sushi`, analysis: `full`, isDeFi: true, isSmartYield: true },
{ assetSymbol: `mc`, analysis: `full`, isDeFi: false, isSmartYield: true },
];

export const langs: Locale[] = [`en-us`, `fr-fr`, `de-de`];
export const langs = [`en-us`, `fr-fr`, `de-de`];
3 changes: 0 additions & 3 deletions env/prod.js

This file was deleted.

1 change: 1 addition & 0 deletions env/production.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
5 changes: 1 addition & 4 deletions env/stage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
module.exports = {
REFERRAL_REGISTRATION_URL:
"https://app-stage.swissborg.io/v2/referrals/register",
};
module.exports = {};
128 changes: 4 additions & 124 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
@@ -1,136 +1,16 @@
import type { GatsbyConfig } from 'gatsby';
import path from 'path';

const segmentWriteKey = process.env.SEGMENT_WRITE_KEY || `xxx-xxx-xxx`;
const siteUrl = process.env.SITE_URL || `http://localhost:9000/`;

const config: GatsbyConfig = {
// Since `gatsby-plugin-typescript` is automatically included in Gatsby you
// don't need to define it here (just if you need to change the options)
pathPrefix: `/asset/`,
siteMetadata: {
title: `WealthApp`,
description: `WealthApp by SwissBorg`,
author: `SwissBorg`,
title: `TODO`,
description: `TODO`,
author: `TODO`,
siteUrl,
},
plugins: [
`gatsby-env-variables`,
`gatsby-plugin-styled-components`,
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-plugin-robots-txt`,
options: {
policy: [{ userAgent: `*`, disallow: [`/`] }],
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: path.resolve(`src/images`),
},
},
{
resolve: `gatsby-plugin-react-svg`,
options: {
rule: {
include: path.resolve(`src/assets/fontIcons`),
},
},
},
{
resolve: `gatsby-source-prismic`,
options: {
repositoryName: `swissborg`,
linkResolver: require(`./src/linkResolver`).linkResolver,
schemas: {
blogpost: {},
daa_post: {},
daa_home: {},
'daa-home': {},
daa_blog_post: {},
blog_home: {},
example_video_type: {},
post: {},
terms_and_conditions: require(`./prismic-types/terms_and_conditions.json`),
privacy_policy: require(`./prismic-types/privacy_policy.json`),
asset_analysis: {},
yield_terms_and_conditions: require(`./prismic-types/yield_terms_and_conditions.json`),
chsb_yield_terms_and_conditions: require(`./prismic-types/chsb_yield_terms_and_conditions.json`),
app_tour: {},
premium_tour: {},
fees_values_minmax: require(`./prismic-types/fees_values_minmax.json`),
fees_exchange: require(`./prismic-types/fees_exchange.json`),
app_tour_stage: {},
premium_tour_stage: {},
daa_video: require(`./prismic-types/daa_video.json`),
yield_terms_and_conditions_1_5: require(`./prismic-types/yield_terms_and_conditions_1_5.json`),
fees: require(`./prismic-types/fees.json`),
test_blog_post: require(`./prismic-types/test_blog_post.json`),
},
},
},
`gatsby-plugin-image`,

// TODO possibly move to CHSB page creation
{
resolve: `gatsby-source-custom-api`,
options: {
rootKey: `chsbStaking`,
url: `https://s3-eu-west-1.amazonaws.com/files.swissborg.com/product/website/stats-feed/wap_overview.json`,
schemas: {
transaction: `
dateTime: String
chsbAmountTokens: String
url: String
`,
chsbStaking: `
timestamp: String
premiumUsersCount: Float
premiumUsersLastWeekCount: Float
chsbStackedTokens: Float
chsbBurnedTokens: Float
chsbBurnedUSD: Float
chsbToBurnUSD: Float
chsbToBurnTokens: Float
chsbYieldPledgedTokens: Float
chsbInYieldPercentage: Float
chsbStackedPercentage: Float
transactions: [transaction]
chsbInBuyBackPoolTokens: Float
chsbInBuyBackPoolPercentage: Float
`,
},
},
},

// TODO possibly move to CHSB page creation
{
resolve: `gatsby-source-custom-api`,
options: {
rootKey: `chsbYieldTiers`,
url: `https://s3.eu-west-1.amazonaws.com/files.swissborg.com/product/website/stats-feed/chsb_yield.json`,
schemas: {
tier: `
lower_bound: Float
upper_bound: Float
label: String
apy: Float
`,
chsbYieldTiers: `
tiers: [tier]
`,
},
},
},
{
resolve: `gatsby-plugin-segment-js`,
options: {
prodKey: segmentWriteKey,
},
},
],
plugins: [`gatsby-env-variables`, `gatsby-plugin-image`],
jsxRuntime: `automatic`,
};

Expand Down
Loading

0 comments on commit 8c03ac2

Please sign in to comment.