Skip to content

Commit f187042

Browse files
committed
refactor: use PascalCase for constants
refactor: disable react in scope rule refactor: reorganize atomic components
1 parent f62a64d commit f187042

35 files changed

+55
-56
lines changed

.eslintrc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ parserOptions:
3535
jsx: true
3636
ecmaVersion: "latest"
3737
root: true
38+
rules:
39+
"react/react-in-jsx-scope": "off"
3840
settings:
3941
react:
4042
version: "detect"

docs/api/01-overview.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 1
44
title: "Overview"
55
---
66

7-
import LinkPreview from "@site/src/components/LinkPreview";
7+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
88

99
# The Sablier APIs
1010

docs/api/05-development.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 5
44
title: "Development"
55
---
66

7-
import LinkPreview from "@site/src/components/LinkPreview";
7+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
88

99
## The Graph
1010

docs/api/07-legacy.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 7
44
title: "Legacy"
55
---
66

7-
import LinkPreview from "@site/src/components/LinkPreview";
7+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
88

99
# Sablier Legacy
1010

docs/api/airdrops/01-overview.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 1
44
title: "Overview"
55
---
66

7-
import LinkPreview from "@site/src/components/LinkPreview";
7+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
88

99
# Airdrops
1010

docs/api/airdrops/02-endpoints.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: "Endpoints"
77
import DeprecatedSubgraphs from "@site/docs/snippets/DeprecatedSubgraphs.mdx";
88
import EnvioEndpoints from "@site/docs/snippets/EnvioEndpoints.mdx";
99
import TheGraphEndpoints from "@site/docs/snippets/TheGraphEndpoints.mdx";
10-
import LinkPreview from "@site/src/components/LinkPreview";
10+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
1111

1212
# Airdrops Endpoints
1313

docs/api/airdrops/merkle-api/01-overview.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 1
44
title: "Overview"
55
---
66

7-
import LinkPreview from "@site/src/components/LinkPreview";
7+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
88

99
Sablier's Airdrops rely on pre-configured Merkle trees. This data structure contains the list of recipients as well as
1010
their individual claim details.

docs/api/airdrops/merkle-api/02-functionality.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 2
44
title: "Functionality"
55
---
66

7-
import LinkPreview from "@site/src/components/LinkPreview";
7+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
88

99
## Architecture
1010

docs/api/flow/01-overview.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 1
44
title: "Overview"
55
---
66

7-
import LinkPreview from "@site/src/components/LinkPreview";
7+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
88

99
# Sablier Flow
1010

docs/api/flow/02-endpoints.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: "Endpoints"
77
import DeprecatedSubgraphs from "@site/docs/snippets/DeprecatedSubgraphs.mdx";
88
import EnvioEndpoints from "@site/docs/snippets/EnvioEndpoints.mdx";
99
import TheGraphEndpoints from "@site/docs/snippets/TheGraphEndpoints.mdx";
10-
import LinkPreview from "@site/src/components/LinkPreview";
10+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
1111

1212
# Flow Endpoints
1313

docs/api/lockup/01-overview.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 1
44
title: "Overview"
55
---
66

7-
import LinkPreview from "@site/src/components/LinkPreview";
7+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
88

99
# Sablier Lockup
1010

docs/api/lockup/02-endpoints.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: "Endpoints"
77
import DeprecatedSubgraphs from "@site/docs/snippets/DeprecatedSubgraphs.mdx";
88
import EnvioEndpoints from "@site/docs/snippets/EnvioEndpoints.mdx";
99
import TheGraphEndpoints from "@site/docs/snippets/TheGraphEndpoints.mdx";
10-
import LinkPreview from "@site/src/components/LinkPreview";
10+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
1111

1212
# Lockup Endpoints
1313

docs/apps/03-branding.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 3
44
title: "Branding"
55
---
66

7-
import LinkPreview from "@site/src/components/LinkPreview";
7+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
88

99
## Brand Guidelines
1010

docs/apps/guides/01-csv-support.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 1
44
title: "CSV Support"
55
---
66

7-
import LinkPreview from "@site/src/components/LinkPreview";
7+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
88

99
The Sablier Interfaces supports CSV files for faster processing and automating large-scale operations. This feature is
1010
available for both airdrops and streams.

docs/concepts/03-use-cases.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "Use Cases"
55
---
66

77
import Link from "@docusaurus/Link";
8-
import { links } from "@site/src/constants";
8+
import { Links } from "@site/src/constants";
99

1010
While Lockup and Flow both are general-purpose protocols that can be used for a wide variety of applications, some use
1111
cases are more popular than others. In this article, we will cover the primary reasons people are using Sablier Lockup
@@ -67,7 +67,7 @@ funds are allocated and for what purposes.
6767
With Sablier streams, the issues mentioned above are avoided. Anyone can use the Sablier interface to monitor all
6868
streams created by a particular address, as well as all transactions associated with each stream.
6969

70-
To illustrate this, <Link href={links.example}>here</Link>'s an example of a stream as viewed on the Sablier Interface.
70+
To illustrate this, <Link href={Links.example}>here</Link>'s an example of a stream as viewed on the Sablier Interface.
7171

7272
## Merkle Airdrops
7373

docs/concepts/05-merkle-airdrops.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "Merkle Airdrops"
55
---
66

77
import Link from "@docusaurus/Link";
8-
import { links } from "@site/src/constants";
8+
import { Links } from "@site/src/constants";
99

1010
:::note
1111

@@ -64,7 +64,7 @@ different start time for Vesting depending on when they claim.
6464
Sablier Labs does not currently offer any white label solutions for Merkle Airdrops. This means that you cannot have
6565
your logo displayed in the claim page seen by the airstream recipients.
6666

67-
However, we are actively exploring implementing this feature. Fill out <Link href={links.forms.call}>this form</Link>
67+
However, we are actively exploring implementing this feature. Fill out <Link href={Links.Forms.call}>this form</Link>
6868
and we will respond as soon as possible.
6969

7070
## How it Works

docs/concepts/07-chains.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ sidebar_position: 7
55
---
66

77
import Link from "@docusaurus/Link";
8-
import { links } from "@site/src/constants";
8+
import { Links } from "@site/src/constants";
99

1010
Sablier Protocol is live on 25+ mainnets and 11+ testnets. However, not all of these chains may be supported by the
11-
[Sablier Interface](https://app.sablier.com/). If you're interested in that, fill out <Link href={links.forms.call}>this form</Link>.
11+
[Sablier Interface](https://app.sablier.com/). If you're interested in that, fill out <Link href={Links.Forms.CALL}>this form</Link>.
1212

1313
## Mainnets
1414

@@ -63,5 +63,5 @@ Sablier Protocol is live on 25+ mainnets and 11+ testnets. However, not all of t
6363

6464
- For more information about these EVM chains, such as RPC URLs, check out [Chainlist](https://chainlist.org).
6565
- Do you want to get Sablier deployed on your chain? If you meet the [requirements](/guides/custom-deployments#requirements)
66-
for custom deployment, fill out <Link href={links.forms.chains}>this form</Link> and our team will get back to you.
66+
for custom deployment, fill out <Link href={Links.Forms.CHAINS}>this form</Link> and our team will get back to you.
6767
- Sablier does not support chains with native tokens that do not have 18 decimals.

docs/concepts/08-nft.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "NFTs"
55
---
66

77
import Link from "@docusaurus/Link";
8-
import { links } from "@site/src/constants";
8+
import { Links } from "@site/src/constants";
99
import FlowNFTSVG from "@site/static/img/flow-nft.svg";
1010
import LockupNFTGalleryURL from "@site/static/img/lockup-gallery.webp";
1111
import LockupNFTSVG from "@site/static/img/lockup-nft.svg";
@@ -50,7 +50,7 @@ find more details on it in the [Transferability](/concepts/transferability) sect
5050

5151
:::info
5252

53-
If you're interested in making an integration, please fill out this <Link href={links.forms.call}>form</Link> and we
53+
If you're interested in making an integration, please fill out this <Link href={Links.Forms.CALL}>form</Link> and we
5454
will try to respond as soon as possible.
5555

5656
:::

docs/concepts/lockup/02-stream-shapes.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 2
44
title: "Stream Shapes"
55
---
66

7-
import FunctionPlot from "@site/src/components/FunctionPlot";
7+
import FunctionPlot from "@site/src/components/organisms/FunctionPlot";
88

99
:::note
1010

docs/guides/04-custom-deployments.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ title: "Custom Deployments"
55
---
66

77
import Link from "@docusaurus/Link";
8-
import { links } from "@site/src/constants";
8+
import { Links } from "@site/src/constants";
99

1010
:::info[Reach Out]
1111

1212
{/* prettier-ignore */}
13-
Want to get Sablier deployed on your chain? If you meet the requirements listed below, fill out <Link href={links.forms.chains}>this
13+
Want to get Sablier deployed on your chain? If you meet the requirements listed below, fill out <Link href={Links.Forms.CHAINS}>this
1414
form</Link> and our team will get back to you.
1515

1616
:::
1717

1818
## Requirements
1919

2020
The Sablier Interface currently supports only The Graph and Envio indexer services. If you use a different indexer, you
21-
can schedule a call <Link href={links.forms.call}>here</Link> to discuss integration.
21+
can schedule a call <Link href={Links.Forms.CALL}>here</Link> to discuss integration.
2222

2323
- [x] Blockchain explorer with instructions for verifying contracts
2424
- [x] Functional JSON-RPC endpoint, preferably listed on [ChainList](https://chainlist.org)

docs/guides/legacy/03-codebase.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Codebase
44
sidebar_position: 5
55
---
66

7-
import LinkPreview from "../../../src/components/LinkPreview";
7+
import LinkPreview from "@site/src/components/molecules/LinkPreview";
88

99
## Repository
1010

docusaurus.config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type * as Preset from "@docusaurus/preset-classic";
22
import type { Config } from "@docusaurus/types";
33
import { themes as prismThemes } from "prism-react-renderer";
44
import rehypeKatex from "rehype-katex";
5+
import remarkGfm from "remark-gfm";
56
import remarkMath from "remark-math";
67

78
const config: Config = {
@@ -26,7 +27,7 @@ const config: Config = {
2627
editUrl: "https://github.com/sablier-labs/docs/blob/main/",
2728
rehypePlugins: [rehypeKatex],
2829
routeBasePath: "/", // Serve the docs at the site's root
29-
remarkPlugins: [remarkMath],
30+
remarkPlugins: [remarkGfm, remarkMath],
3031
sidebarPath: require.resolve("./sidebars.js"),
3132
},
3233
theme: {

src/components/molecules/Feature.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from "react";
21
import styled from "@emotion/styled";
32
import Link from "@docusaurus/Link";
43
import ArrowRightIcon from "@heroicons/react/24/outline/ArrowRightIcon";

src/components/LinkPreview.tsx renamed to src/components/molecules/LinkPreview.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useCallback } from "react";
1+
import { useCallback } from "react";
22
import styled from "@emotion/styled";
33
import Link from "@docusaurus/Link";
44
import SablierIcon from "@site/static/img/logo.svg";

src/components/atoms/Background.tsx renamed to src/components/organisms/Background.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from "react";
21
import type { PropsWithChildren } from "react";
32
import styled from "@emotion/styled";
43

src/components/FunctionPlot.tsx renamed to src/components/organisms/FunctionPlot.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useRef } from "react";
1+
import { memo, useEffect, useRef } from "react";
22
import functionPlot, { FunctionPlotOptions } from "function-plot";
33

44
export interface ExtendedFunctionPlotOptions extends FunctionPlotOptions {
@@ -12,7 +12,7 @@ export interface FunctionPlotProps {
1212
}
1313

1414
// See https://github.com/mauriciopoppe/function-plot
15-
const FunctionPlot: React.FC<FunctionPlotProps> = React.memo(function ({ options }: FunctionPlotProps) {
15+
const FunctionPlot: React.FC<FunctionPlotProps> = memo(function ({ options }: FunctionPlotProps) {
1616
const rootEl = useRef(null);
1717

1818
useEffect(() => {

src/components/organisms/Header.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from "react";
21
import styled from "@emotion/styled";
32
import BoltIcon from "@heroicons/react/24/outline/BoltIcon";
43
import CodeBracketIcon from "@heroicons/react/24/outline/CodeBracketIcon";
@@ -7,7 +6,7 @@ import DocumentTextIcon from "@heroicons/react/24/outline/DocumentTextIcon";
76
import LightBulbIcon from "@heroicons/react/24/outline/LightBulbIcon";
87
import Heading from "@theme/Heading";
98
import Feature from "../molecules/Feature";
10-
import Underlay from "./Header/Underlay";
9+
import Underlay from "./header/Underlay";
1110

1211
const Wrapper = styled.header`
1312
width: 100%;

src/components/organisms/Socials.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import React from "react";
21
import styled from "@emotion/styled";
32
import Link from "@docusaurus/Link";
43
import Heading from "@theme/Heading";
5-
import { links } from "../../constants";
4+
import { Links } from "../../constants";
65

76
const Wrapper = styled.main`
87
display: flex;
@@ -80,23 +79,23 @@ function Socials() {
8079
return (
8180
<Wrapper>
8281
<List>
83-
<Social href={links.discord}>
82+
<Social href={Links.DISCORD}>
8483
<img src="img/social/discord.svg" style={{ width: "48px", height: "48px" }} />
8584
<div>
8685
<Heading as="h4">Discord</Heading>
8786
<p>Hop in to the #dev channel to get help.</p>
8887
</div>
8988
</Social>
9089

91-
<Social href={links.github}>
90+
<Social href={Links.GitHub.ORG}>
9291
<img src="img/social/github.svg" style={{ width: "44px", height: "44px" }} />
9392
<div>
9493
<Heading as="h4">GitHub</Heading>
9594
<p>View all Sablier code repositories.</p>
9695
</div>
9796
</Social>
9897

99-
<Social href={links.blog}>
98+
<Social href={Links.BLOG}>
10099
<div>
101100
<img src="img/logo.svg" style={{ width: "48px", height: "48px" }} />
102101
</div>

src/components/organisms/Header/Underlay.tsx renamed to src/components/organisms/header/Underlay.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import React from "react";
21
import styled from "@emotion/styled";
32
import useBaseUrl from "@docusaurus/useBaseUrl";
4-
import Background from "../../atoms/Background";
3+
import Background from "../Background";
54

65
const Mesh = styled.div<{ image?: string }>`
76
position: absolute;

src/constants.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const Links = {
2+
Forms: {
3+
CALL: "https://forms.gle/6z3XyfSLXDoRghG99",
4+
CHAINS: "https://forms.gle/9EaRarDie98Fw1mw6",
5+
},
6+
GitHub: {
7+
DEPLOYMENTS: "https://github.com/sablier-labs/deployments",
8+
ORG: "https://github.com/sablier-labs",
9+
},
10+
APP: "https://app.sablier.com",
11+
BLOG: "https://blog.sablier.com",
12+
DISCORD: "https://discord.sablier.com",
13+
EXAMPLE: "https://app.sablier.com/stream/LL2-11155111-3/",
14+
};

src/constants/index.ts

-1
This file was deleted.

src/constants/links.ts

-11
This file was deleted.

src/pages/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from "react";
21
import styled from "@emotion/styled";
32
import Layout from "@theme/Layout";
43
import Header from "../components/organisms/Header";

src/theme/MDXComponents/A.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import styled from "@emotion/styled";
33
import ArrowIcon from "@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";
44
import A from "@theme-original/MDXComponents/A";
5-
import React, { useMemo } from "react";
5+
import { useMemo } from "react";
66

77
const Arrow = styled.span`
88
display: inline-block;

0 commit comments

Comments
 (0)