From f9b77511d21d8e0e22d8dc00114a6065e5e64091 Mon Sep 17 00:00:00 2001 From: ryanchristo <12519942+ryanchristo@users.noreply.github.com> Date: Sun, 5 Nov 2023 08:54:38 -0800 Subject: [PATCH] fix and format --- .prettierrc | 4 +++ app/globals.css | 34 +++++++++++------------ app/layout.tsx | 12 ++++---- app/not-found.tsx | 16 +++++------ app/page.tsx | 50 +++++++++++++++++----------------- app/products/page.tsx | 22 +++++++-------- app/solutions/page.tsx | 18 ++++++------ app/validator/page.tsx | 48 ++++++++++++++++---------------- components/Background.tsx | 22 +++++++-------- components/Footer.tsx | 56 +++++++++++++++++++------------------- components/Header.tsx | 50 +++++++++++++++++----------------- components/ThemeButton.tsx | 12 ++++---- contexts/ThemeContext.tsx | 48 ++++++++++++++++---------------- module.d.ts | 2 +- next.config.js | 8 +++--- postcss.config.js | 2 +- tailwind.config.ts | 4 +-- 17 files changed, 206 insertions(+), 202 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b2095be --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "semi": false, + "singleQuote": true +} diff --git a/app/globals.css b/app/globals.css index 61fe348..0bdaae6 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,63 +1,63 @@ @font-face { - font-family: "Ubuntu"; + font-family: 'Ubuntu'; font-style: normal; font-weight: normal; - src: url("../public/font/Ubuntu-Regular.ttf"); + src: url('../public/font/Ubuntu-Regular.ttf'); } @font-face { - font-family: "Ubuntu"; + font-family: 'Ubuntu'; font-style: italic; font-weight: normal; - src: url("../public/font/Ubuntu-Italic.ttf"); + src: url('../public/font/Ubuntu-Italic.ttf'); } @font-face { - font-family: "Ubuntu"; + font-family: 'Ubuntu'; font-style: normal; font-weight: bold; - src: url("../public/font/Ubuntu-Bold.ttf"); + src: url('../public/font/Ubuntu-Bold.ttf'); } @font-face { - font-family: "Ubuntu"; + font-family: 'Ubuntu'; font-style: italic; font-weight: bold; - src: url("../public/font/Ubuntu-BoldItalic.ttf"); + src: url('../public/font/Ubuntu-BoldItalic.ttf'); } @font-face { - font-family: "Ubuntu"; + font-family: 'Ubuntu'; font-style: normal; font-weight: 300; - src: url("../public/font/Ubuntu-Light.ttf"); + src: url('../public/font/Ubuntu-Light.ttf'); } @font-face { - font-family: "Ubuntu"; + font-family: 'Ubuntu'; font-style: italic; font-weight: 300; - src: url("../public/font/Ubuntu-LightItalic.ttf"); + src: url('../public/font/Ubuntu-LightItalic.ttf'); } @font-face { - font-family: "Ubuntu"; + font-family: 'Ubuntu'; font-style: normal; font-weight: 500; - src: url("../public/font/Ubuntu-Medium.ttf"); + src: url('../public/font/Ubuntu-Medium.ttf'); } @font-face { - font-family: "Ubuntu"; + font-family: 'Ubuntu'; font-style: italic; font-weight: 500; - src: url("../public/font/Ubuntu-MediumItalic.ttf"); + src: url('../public/font/Ubuntu-MediumItalic.ttf'); } :root { --color-error: rgb(245, 45, 45); --color-theme: rgb(0, 195, 165); - --font-family: "Ubuntu", sans-serif; + --font-family: 'Ubuntu', sans-serif; --footer-height: 320px; --header-height: 80px; --sidebar-width: 240px; diff --git a/app/layout.tsx b/app/layout.tsx index c1c5312..dd1f8c4 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,9 +1,9 @@ -import { ThemeContextProvider } from "@contexts/ThemeContext"; +import { ThemeContextProvider } from '@contexts/ThemeContext' -import Footer from "@components/Footer"; -import Header from "@components/Header"; +import Footer from '@components/Footer' +import Header from '@components/Header' -import "./globals.css"; +import './globals.css' const Layout = ({ children }: any) => ( @@ -17,6 +17,6 @@ const Layout = ({ children }: any) => ( -); +) -export default Layout; +export default Layout diff --git a/app/not-found.tsx b/app/not-found.tsx index ff61603..eda36ac 100644 --- a/app/not-found.tsx +++ b/app/not-found.tsx @@ -1,18 +1,18 @@ -import { Metadata } from "next"; +import { Metadata } from 'next' -import styles from "./not-found.module.css"; +import styles from './not-found.module.css' export const metadata: Metadata = { - title: "404 | a placeless place", -}; + title: '404 | a placeless place', +} const NotFoundPage = () => (
-

{"404"}

-

{"a placeless place"}

+

{'404'}

+

{'a placeless place'}

-); +) -export default NotFoundPage; +export default NotFoundPage diff --git a/app/page.tsx b/app/page.tsx index fee4dc1..738e7cb 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,12 +1,12 @@ -import { Metadata } from "next"; +import { Metadata } from 'next' -import Background from "@components/Background"; +import Background from '@components/Background' -import styles from "./page.module.css"; +import styles from './page.module.css' export const metadata: Metadata = { - title: "chora studio | research and development", -}; + title: 'chora studio | research and development', +} const HomePage = () => { return ( @@ -15,61 +15,61 @@ const HomePage = () => {

- {"chora "} - {"studio"} + {'chora '} + {'studio'}

- {"what is the role of technology in ecological regeneration?"} + {'what is the role of technology in ecological regeneration?'}

-

{"software research and development"}

+

{'software research and development'}

-

{"products"}

+

{'products'}

- {"Chora Studio is stewarding "} + {'Chora Studio is stewarding '} - {"Chora Protocol"} + {'Chora Protocol'} { - " - distributed ledger technology for commons governance and ecological regeneration." + ' - distributed ledger technology for commons governance and ecological regeneration.' }

- {"learn more ⇾"} + {'learn more ⇾'}

-

{"solutions"}

+

{'solutions'}

{ - "Chora Studio offers software research and development consulting services to clients building infrastructure for climate solutions." + 'Chora Studio offers software research and development consulting services to clients building infrastructure for climate solutions.' }

- {"learn more ⇾"} + {'learn more ⇾'}

-

{"validator"}

+

{'validator'}

- {"Chora Studio operates Chora Validator on "} + {'Chora Studio operates Chora Validator on '} - {"Regen"} + {'Regen'} { - " and multiple test networks including Regen Redwood and Chora Testnet." + ' and multiple test networks including Regen Redwood and Chora Testnet.' }

- {"learn more ⇾"} + {'learn more ⇾'}

- ); -}; + ) +} -export default HomePage; +export default HomePage diff --git a/app/products/page.tsx b/app/products/page.tsx index e11fa9b..cd51729 100644 --- a/app/products/page.tsx +++ b/app/products/page.tsx @@ -1,30 +1,30 @@ -import { Metadata } from "next"; +import { Metadata } from 'next' -import styles from "./page.module.css"; +import styles from './page.module.css' export const metadata: Metadata = { - title: "chora studio | products", -}; + title: 'chora studio | products', +} const ProductsPage = () => { return (
-

{"products"}

+

{'products'}

- {"Chora Studio is stewarding "} + {'Chora Studio is stewarding '} - {"Chora Protocol"} + {'Chora Protocol'} { - " - distributed ledger technology for commons governance and ecological regeneration." + ' - distributed ledger technology for commons governance and ecological regeneration.' }

- ); -}; + ) +} -export default ProductsPage; +export default ProductsPage diff --git a/app/solutions/page.tsx b/app/solutions/page.tsx index d752bdb..5cd2593 100644 --- a/app/solutions/page.tsx +++ b/app/solutions/page.tsx @@ -1,26 +1,26 @@ -import { Metadata } from "next"; +import { Metadata } from 'next' -import styles from "./page.module.css"; +import styles from './page.module.css' export const metadata: Metadata = { - title: "chora studio | solutions", -}; + title: 'chora studio | solutions', +} const SolutionsPage = () => { return (
-

{"solutions"}

+

{'solutions'}

{ - "Chora Studio offers software research and development consulting services to clients building infrastructure for climate solutions." + 'Chora Studio offers software research and development consulting services to clients building infrastructure for climate solutions.' }

- ); -}; + ) +} -export default SolutionsPage; +export default SolutionsPage diff --git a/app/validator/page.tsx b/app/validator/page.tsx index 5a662ad..5e9963e 100644 --- a/app/validator/page.tsx +++ b/app/validator/page.tsx @@ -1,73 +1,73 @@ -import { Metadata } from "next"; +import { Metadata } from 'next' -import styles from "./page.module.css"; +import styles from './page.module.css' export const metadata: Metadata = { - title: "chora studio | validator", -}; + title: 'chora studio | validator', +} const regenLink = - "https://www.mintscan.io/regen/validators/regenvaloper1t8p3zdu3h8qzggfmvvvmtdnaj4trcsfh79xp4e"; + 'https://www.mintscan.io/regen/validators/regenvaloper1t8p3zdu3h8qzggfmvvvmtdnaj4trcsfh79xp4e' const ValidatorPage = () => { return (
-

{"validator"}

+

{'validator'}

- {"Chora Studio operates Chora Validator on "} + {'Chora Studio operates Chora Validator on '} - {"Regen"} + {'Regen'} { - " and multiple test networks including Regen Redwood and Chora Testnet." + ' and multiple test networks including Regen Redwood and Chora Testnet.' }

-

{"what is a validator?"}

+

{'what is a validator?'}

{ - "In the context of distributed ledger technology, a validator is a node in a network responsible for verifying and producing state transitions. Validators play a critical role in ensuring the security and integrity of a network. " + 'In the context of distributed ledger technology, a validator is a node in a network responsible for verifying and producing state transitions. Validators play a critical role in ensuring the security and integrity of a network. ' }

{ - "Chora Validator is currently operating on proof-of-stake blockchains in the Cosmos ecosystem. On proof-of-stake networks, validators stake tokens (i.e. lock up their tokens in the network) and then earn rewards for successfully verifying and producing blocks. Validators are also penalized for downtime or acting maliciously. When a validator is penalized, a portion of the staked tokens are slashed (i.e. destroyed and cannot be recovered)." + 'Chora Validator is currently operating on proof-of-stake blockchains in the Cosmos ecosystem. On proof-of-stake networks, validators stake tokens (i.e. lock up their tokens in the network) and then earn rewards for successfully verifying and producing blocks. Validators are also penalized for downtime or acting maliciously. When a validator is penalized, a portion of the staked tokens are slashed (i.e. destroyed and cannot be recovered).' }

{ - "In the Cosmos ecosystem, token holders stake tokens with validators to earn rewards alongside validators. When a validator is penalized for downtime or acting maliciously, the token holders are also penalized, i.e. a portion of the staked tokens from each account staking with the validator is slashed. Token holders are therefore incentivized to stake tokens with validators they trust, which in turn reduces the risk of lost assets and helps to ensure the security and integrity of the network." + 'In the Cosmos ecosystem, token holders stake tokens with validators to earn rewards alongside validators. When a validator is penalized for downtime or acting maliciously, the token holders are also penalized, i.e. a portion of the staked tokens from each account staking with the validator is slashed. Token holders are therefore incentivized to stake tokens with validators they trust, which in turn reduces the risk of lost assets and helps to ensure the security and integrity of the network.' }

-

{"what about governance?"}

+

{'what about governance?'}

{ - "In addition to verifying and producing blocks, validators on proof-of-stake networks in the Cosmos ecosystem also act as representatives in network governance. When staking with a validator in the Cosmos ecosystem, token holders are also delegating their voting power (i.e. one token, one vote) to the validator. Token holders have the option to cancel out their delegated votes by voting independently. If a token holder does not intend to vote on every governance proposal independently, they should stake with validators they think will best represent their interests." + 'In addition to verifying and producing blocks, validators on proof-of-stake networks in the Cosmos ecosystem also act as representatives in network governance. When staking with a validator in the Cosmos ecosystem, token holders are also delegating their voting power (i.e. one token, one vote) to the validator. Token holders have the option to cancel out their delegated votes by voting independently. If a token holder does not intend to vote on every governance proposal independently, they should stake with validators they think will best represent their interests.' }

-

{"what about other services?"}

+

{'what about other services?'}

{ - "Although not required, validators (or companies running validators) often provide additional tools and services as public goods for the benefit of the network. For example, some may run additional infrastructure such as full nodes, archive nodes, relayers, oracle services, or a testnet validator on the corresponding test network, some may contribute to designing, building, or maintaining software, some may organize working groups and publish their research, etc. Token holders may want to consider staking with validators that bring additional and diverse forms of value to the network." + 'Although not required, validators (or companies running validators) often provide additional tools and services as public goods for the benefit of the network. For example, some may run additional infrastructure such as full nodes, archive nodes, relayers, oracle services, or a testnet validator on the corresponding test network, some may contribute to designing, building, or maintaining software, some may organize working groups and publish their research, etc. Token holders may want to consider staking with validators that bring additional and diverse forms of value to the network.' }

-

{"why choose chora validator?"}

+

{'why choose chora validator?'}

{ - "Chora Validator is committed to ensuring the security and integrity of every network that Chora Validator operates on. Chora Validator is operated by senior software engineers with more than two years of experience building, maintaining, and testing software within the Cosmos ecosystem." + 'Chora Validator is committed to ensuring the security and integrity of every network that Chora Validator operates on. Chora Validator is operated by senior software engineers with more than two years of experience building, maintaining, and testing software within the Cosmos ecosystem.' }

-

{"regen"}

+

{'regen'}

{ - "Chora Validator is running a validator node and a full node with public API endpoints. Chora Validator is also running a testnet validator node on Regen Redwood (the stable test network for Regen). Chora Validator is committed to offsetting energy costs with carbon credits issued on Regen." + 'Chora Validator is running a validator node and a full node with public API endpoints. Chora Validator is also running a testnet validator node on Regen Redwood (the stable test network for Regen). Chora Validator is committed to offsetting energy costs with carbon credits issued on Regen.' }

- ); -}; + ) +} -export default ValidatorPage; +export default ValidatorPage diff --git a/components/Background.tsx b/components/Background.tsx index 6542707..6274ae1 100644 --- a/components/Background.tsx +++ b/components/Background.tsx @@ -1,21 +1,21 @@ -"use client"; +'use client' -import { ThemeContext } from "@contexts/ThemeContext"; -import darkBackground from "../public/images/chora_dark.png"; -import lightBackground from "../public/images/chora_light.png"; -import Image from "next/image"; -import { useContext } from "react"; +import { ThemeContext } from '@contexts/ThemeContext' +import darkBackground from '../public/images/chora_dark.png' +import lightBackground from '../public/images/chora_light.png' +import Image from 'next/image' +import { useContext } from 'react' -import styles from "./Background.module.css"; +import styles from './Background.module.css' const Background = () => { - const { darkTheme } = useContext(ThemeContext); + const { darkTheme } = useContext(ThemeContext) return (
chora
- ); -}; + ) +} -export default Background; +export default Background diff --git a/components/Footer.tsx b/components/Footer.tsx index 5bea994..67c455e 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -1,73 +1,73 @@ -"use client"; +'use client' -import { ThemeContext } from "@contexts/ThemeContext"; -import choraLogoDark from "../public/images/chora_dark_small.png"; -import choraLogoLight from "../public/images/chora_light_small.png"; -import Image from "next/image"; -import Link from "next/link"; -import { useContext } from "react"; +import { ThemeContext } from '@contexts/ThemeContext' +import choraLogoDark from '../public/images/chora_dark_small.png' +import choraLogoLight from '../public/images/chora_light_small.png' +import Image from 'next/image' +import Link from 'next/link' +import { useContext } from 'react' -import styles from "./Footer.module.css"; +import styles from './Footer.module.css' const Footer = () => { - const { darkTheme } = useContext(ThemeContext); + const { darkTheme } = useContext(ThemeContext) return (
-
{darkTheme.toString()}
+
{darkTheme.toString()}
chora -

{"© 2023 Chora Studio, LLC"}

+

{'© 2023 Chora Studio, LLC'}

-

{"chora studio"}

+

{'chora studio'}

  • - - {"blog ↗"} + + {'blog ↗'}
  • - {"products"} + {'products'}
  • - {"solutions"} + {'solutions'}
  • - {"validator"} + {'validator'}
-

{"chora protocol"}

+

{'chora protocol'}

  • - {"chora applications ↗"} + {'chora applications ↗'}
  • - {"chora documentation ↗"} + {'chora documentation ↗'}
  • - {"chora repositories ↗"} + {'chora repositories ↗'}
-

{"chora validator"}

+

{'chora validator'}

  • - {"regen ↗"} + {'regen ↗'}
  • @@ -75,7 +75,7 @@ const Footer = () => { href="https://chora.io/scan/regen-redwood-1" target="_blank" > - {"regen-redwood ↗"} + {'regen-redwood ↗'}
  • @@ -83,14 +83,14 @@ const Footer = () => { href="https://chora.io/scan/chora-testnet-1" target="_blank" > - {"chora-testnet ↗"} + {'chora-testnet ↗'}
- ); -}; + ) +} -export default Footer; +export default Footer diff --git a/components/Header.tsx b/components/Header.tsx index de5c5f3..535bea1 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -1,29 +1,29 @@ -"use client"; +'use client' -import { ThemeContext } from "@contexts/ThemeContext"; -import choraLogoDark from "../public/images/chora_dark_small.png"; -import choraLogoLight from "../public/images/chora_light_small.png"; -import ThemeButton from "@components/ThemeButton"; -import Image from "next/image"; -import Link from "next/link"; -import { useContext } from "react"; +import { ThemeContext } from '@contexts/ThemeContext' +import choraLogoDark from '../public/images/chora_dark_small.png' +import choraLogoLight from '../public/images/chora_light_small.png' +import ThemeButton from '@components/ThemeButton' +import Image from 'next/image' +import Link from 'next/link' +import { useContext } from 'react' -import styles from "./Header.module.css"; +import styles from './Header.module.css' const Header = () => { - const { darkTheme, setDarkTheme } = useContext(ThemeContext); + const { darkTheme, setDarkTheme } = useContext(ThemeContext) const toggleTheme = () => { if (darkTheme) { - setDarkTheme(false); + setDarkTheme(false) } else { - setDarkTheme(true); + setDarkTheme(true) } - }; + } return (
-
{darkTheme.toString()}
+
{darkTheme.toString()}
@@ -32,26 +32,26 @@ const Header = () => { src={darkTheme ? choraLogoDark : choraLogoLight} />
- {"chora "} - {"studio"} + {'chora '} + {'studio'}
  • - {"products"} + {'products'}
  • - {"solutions"} + {'solutions'}
  • - {"validator"} + {'validator'}
  • -
  • {"|"}
  • +
  • {'|'}
  • - - {"blog ↗"} + + {'blog ↗'}
@@ -59,7 +59,7 @@ const Header = () => {
- ); -}; + ) +} -export default Header; +export default Header diff --git a/components/ThemeButton.tsx b/components/ThemeButton.tsx index 81e5aae..52e4e87 100644 --- a/components/ThemeButton.tsx +++ b/components/ThemeButton.tsx @@ -1,6 +1,6 @@ -import * as React from "react"; +import * as React from 'react' -import styles from "./ThemeButton.module.css"; +import styles from './ThemeButton.module.css' const ThemeButton = ({ darkTheme, toggleTheme }: any) => ( -); +) -export default ThemeButton; +export default ThemeButton diff --git a/contexts/ThemeContext.tsx b/contexts/ThemeContext.tsx index dda738e..3f1ee63 100644 --- a/contexts/ThemeContext.tsx +++ b/contexts/ThemeContext.tsx @@ -1,45 +1,45 @@ -"use client"; +'use client' -import * as React from "react"; -import { createContext, useEffect, useState } from "react"; +import * as React from 'react' +import { createContext, useEffect, useState } from 'react' -export const cachedDarkKey = "chora-web-dark"; +export const cachedDarkKey = 'chora-web-dark' const initDarkTheme = () => { - let initDarkTheme = false; + let initDarkTheme = false if ( - typeof localStorage !== "undefined" && + typeof localStorage !== 'undefined' && localStorage.getItem(cachedDarkKey) ) { - initDarkTheme = localStorage.getItem(cachedDarkKey) === "true"; - } else if (typeof window !== "undefined") { - initDarkTheme = window.matchMedia("(prefers-color-scheme: dark)").matches; + initDarkTheme = localStorage.getItem(cachedDarkKey) === 'true' + } else if (typeof window !== 'undefined') { + initDarkTheme = window.matchMedia('(prefers-color-scheme: dark)').matches } - return initDarkTheme; -}; + return initDarkTheme +} -const ThemeContext = createContext({}); +const ThemeContext = createContext({}) const ThemeContextProvider = (props: any) => { - const [darkTheme, setDarkTheme] = useState(initDarkTheme()); + const [darkTheme, setDarkTheme] = useState(initDarkTheme()) useEffect(() => { - if (typeof window !== "undefined" && typeof localStorage !== "undefined") { - const root = window.document.documentElement; + if (typeof window !== 'undefined' && typeof localStorage !== 'undefined') { + const root = window.document.documentElement if (darkTheme) { - root.classList.add("dark-theme"); - root.style.backgroundColor = "#161616"; // --background-secondary (dark-theme) + root.classList.add('dark-theme') + root.style.backgroundColor = '#161616' // --background-secondary (dark-theme) } else { - root.classList.remove("dark-theme"); - root.style.backgroundColor = "#FAFAFA"; // --background-secondary (light-theme) + root.classList.remove('dark-theme') + root.style.backgroundColor = '#FAFAFA' // --background-secondary (light-theme) } - localStorage.setItem(cachedDarkKey, darkTheme ? "true" : "false"); + localStorage.setItem(cachedDarkKey, darkTheme ? 'true' : 'false') } - }, [darkTheme]); + }, [darkTheme]) return ( { > {props.children} - ); -}; + ) +} -export { ThemeContext, ThemeContextProvider }; +export { ThemeContext, ThemeContextProvider } diff --git a/module.d.ts b/module.d.ts index 1eabbb4..6c344ed 100644 --- a/module.d.ts +++ b/module.d.ts @@ -1 +1 @@ -declare module "*.module.css"; +declare module '*.module.css' diff --git a/next.config.js b/next.config.js index a3efa95..6d6c6e3 100644 --- a/next.config.js +++ b/next.config.js @@ -1,8 +1,8 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - distDir: "dist", - output: "export", + distDir: 'dist', + output: 'export', images: { unoptimized: true }, -}; +} -module.exports = nextConfig; +module.exports = nextConfig diff --git a/postcss.config.js b/postcss.config.js index 4df9d3b..6e41d95 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { autoprefixer: {}, tailwindcss: {}, }, -}; +} diff --git a/tailwind.config.ts b/tailwind.config.ts index 2b2c90f..9a4e1ea 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,3 +1,3 @@ module.exports = { - content: ["./app/**/*.{js,ts,jsx,tsx}"], -}; + content: ['./app/**/*.{js,ts,jsx,tsx}'], +}