Skip to content

Commit

Permalink
Merge branch 'website/v4' of https://github.com/forbole/website into …
Browse files Browse the repository at this point in the history
…m/fix-logo
  • Loading branch information
MonikaCat committed Nov 16, 2023
2 parents aea1869 + 09a87b7 commit b69be49
Show file tree
Hide file tree
Showing 188 changed files with 3,399 additions and 1,980 deletions.
3 changes: 3 additions & 0 deletions .env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ NEXT_PUBLIC_MATOMO_SITE_ID=1
NEXT_PUBLIC_GRAPHQL_API=https://api.forbole.com/graphql
NEXT_PUBLIC_COINGECKO_API=https://api.coingecko.com/api/v3

# Only intended for using in local environment
BUNDLE_ANALYZER=false

# Optional, to send the email to different account locally (not added into
# docker)
SEND_EMAIL_TO=
8 changes: 6 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["react", "@typescript-eslint", "prettier"],
plugins: ["react", "@typescript-eslint", "prettier", "react-hooks"],
rules: {
"arrow-body-style": "error",
"camelcase": "off",
Expand All @@ -22,8 +22,10 @@ module.exports = {
"no-unused-vars": "off",
"object-shorthand": "error",
"prefer-const": "error",
"prefer-template": "error",
"quote-props": ["error", "consistent-as-needed"],

"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-var-requires": "off",
Expand Down Expand Up @@ -57,7 +59,6 @@ module.exports = {
},
],

"prefer-template": "error",
"react/function-component-definition": "off",
"react/jsx-boolean-value": "error",
"react/jsx-one-expression-per-line": "off",
Expand All @@ -69,6 +70,9 @@ module.exports = {
"react/react-in-jsx-scope": "off",
"react/require-default-props": "off",
"react/self-closing-comp": "error",

"react-hooks/exhaustive-deps": "error",
"react-hooks/rules-of-hooks": "error",
},
overrides: [
{
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Sitemaps
public/*.xml
test-results

# dependencies
/node_modules
Expand Down
6 changes: 5 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"importOrder": ["^~(.*)$", "^[./]"],
"importOrder": [
"^~(.*)$",
"@(src|utils|components|screens|models|api)",
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"plugins": ["@trivago/prettier-plugin-sort-imports"],
Expand Down
22 changes: 22 additions & 0 deletions e2e/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ test.describe.parallel("Main Pages", () => {
test("Main components", async ({ page }) => {
await page.goto("/");

await page.waitForTimeout(200);

await expect(page.locator('[data-test="footer"]')).toBeVisible();
await expect(page.locator('[data-test="nav"]')).toBeVisible();
});
Expand All @@ -25,6 +27,8 @@ test.describe.parallel("Main Pages", () => {
test("Main components", async ({ page }) => {
await page.goto("/contact");

await page.waitForTimeout(200);

await expect(page.locator('[data-test="contact-submit"]')).toBeVisible();
});
});
Expand All @@ -33,6 +37,8 @@ test.describe.parallel("Main Pages", () => {
test("Main components", async ({ page }) => {
await page.goto("/developer-tools");

await page.waitForTimeout(200);

await expect(page.locator('[data-test="devtools-cta"]')).toBeVisible();
});
});
Expand All @@ -42,6 +48,8 @@ test.describe.parallel("Blog", () => {
test("Main components", async ({ page }) => {
await page.goto("/blog");

await page.waitForTimeout(200);

expect(
await page.locator('[data-test="post-summary-item"]').count(),
).toBeGreaterThan(1);
Expand All @@ -52,9 +60,23 @@ test.describe.parallel("Staking", () => {
test("Main components", async ({ page }) => {
await page.goto("/staking");

await page.waitForTimeout(200);

expect(
await page.locator('[data-test="network-item"]').count(),
).toBeGreaterThan(1);
expect(await page.locator('[data-test="stats-cards"]').count()).toEqual(1);
});
});

test.describe.parallel("Staking Details", () => {
test("Main components", async ({ page }) => {
await page.goto("/staking/how-to-stake-bld-on-agoric");

await page.waitForTimeout(200);

await expect(
page.locator('[data-test="staking-guide-info"]'),
).toBeVisible();
});
});
23 changes: 23 additions & 0 deletions i18next-parser.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default {
contextSeparator: "_",
createOldCatalogs: false,
customValueTemplate: null,
defaultNamespace: "translation",
defaultValue: "",
failOnUpdate: false,
failOnWarnings: true,
i18nextOptions: null,
indentation: 2,
input: undefined,
keepRemoved: false,
keySeparator: ".",
lineEnding: "auto",
locales: ["en", "zh-HK", "zh-CN"],
namespaceSeparator: ":",
output: "public/locales/$LOCALE/$NAMESPACE.json",
pluralSeparator: "_",
resetDefaultValueLocale: null,
sort: true,
verbose: false,
yamlOptions: null,
};
9 changes: 8 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
const bundleAnalyzer = require("@next/bundle-analyzer");
const nextTranslate = require("next-translate");

const localePrefixes = ["", "/zh-HK", "/zh-CN"];

module.exports = nextTranslate({
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.BUNDLE_ANALYZER === "true",
});

const baseConfig = nextTranslate({
poweredByHeader: false,
images: {
unoptimized: true,
Expand Down Expand Up @@ -30,3 +35,5 @@ module.exports = nextTranslate({
ignoreDuringBuilds: true,
},
});

module.exports = withBundleAnalyzer(baseConfig);
Loading

0 comments on commit b69be49

Please sign in to comment.