Skip to content

Commit

Permalink
feat(docs): refactored styles
Browse files Browse the repository at this point in the history
  • Loading branch information
TrofimovAnton85 committed Jun 5, 2024
1 parent 6fcb4e3 commit f5f83fd
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 101 deletions.
3 changes: 2 additions & 1 deletion src/components/ParserOpenRPC/AuthBox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import Link from "@docusaurus/Link";
import styles from "./styles.module.css";
import global from "../global.module.css";

interface AuthBoxProps {
isMetamaskInstalled: boolean;
Expand All @@ -10,7 +11,7 @@ const MetamaskInstallMessage = () => (
<div className={styles.msgWrapper}>
<strong className={styles.msgHeading}>Install MetaMask</strong>
<p className={styles.msgText}>Install MetaMask for your browser to enable interactive features</p>
<Link className={styles.primaryBtn} href="https://metamask.io/download/">Install MetaMask</Link>
<Link className={global.primaryBtn} href="https://metamask.io/download/">Install MetaMask</Link>
</div>
);

Expand Down
23 changes: 0 additions & 23 deletions src/components/ParserOpenRPC/AuthBox/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,3 @@
font-size: 14px;
line-height: 22px;
}

.primaryBtn {
background: #1098FC;
color: #141618;
font-size: 14px;
line-height: 1;
font-weight: 500;
display: inline-flex;
align-items: center;
border-radius: 999px;
padding: 12px 16px;
margin-bottom: 1px;
cursor: pointer;
transition-property: 'color', 'background-color';
transition-duration: .4s;
transition-timing-function: ease;
}

.primaryBtn:hover {
text-decoration: none;
color: #fff;
background-color: #036AB5;
}
39 changes: 1 addition & 38 deletions src/components/ParserOpenRPC/DetailsBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,8 @@ import { MDContent } from "./MDContent";
import { parseSchema } from "./RenderParams";
import clsx from "clsx";
import styles from "./styles.module.css";
import { MethodParam, SchemaComponents } from "@site/src/components/ParserOpenRPC/interfaces";

interface SchemaPropertyType {
name?: string;
$ref?: any;
items?: any;
title?: string;
type: string;
description?: string;
required?: boolean;
properties?: Record<string, SchemaPropertyType>;
enum?: string[];
default?: string;
schema?: Schema;
}

interface Schema {
summary: any;
description: any;
required: boolean;
title: string;
type: string;
properties?: Record<string, SchemaPropertyType>;
items?: SchemaPropertyType;
oneOf?: SchemaPropertyType[];
allOf?: SchemaPropertyType[];
anyOf?: SchemaPropertyType[];
$ref?: string;
}

interface MethodParam {
name: string;
description: string;
schema: Schema;
required?: boolean;
}

interface SchemaComponents {
[key: string]: Schema;
}

interface DetailsBoxProps {
method: string;
Expand Down
40 changes: 1 addition & 39 deletions src/components/ParserOpenRPC/InteractiveBox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,5 @@
import React from "react";

interface SchemaPropertyType {
name?: string;
$ref?: any;
items?: any;
title?: string;
type: string;
description?: string;
required?: boolean;
properties?: Record<string, SchemaPropertyType>;
enum?: string[];
default?: string;
schema?: Schema;
}

interface Schema {
summary: any;
description: any;
required: boolean;
title: string;
type: string;
properties?: Record<string, SchemaPropertyType>;
items?: SchemaPropertyType;
oneOf?: SchemaPropertyType[];
allOf?: SchemaPropertyType[];
anyOf?: SchemaPropertyType[];
$ref?: string;
}

interface MethodParam {
name: string;
description: string;
schema: Schema;
required?: boolean;
}

interface SchemaComponents {
[key: string]: Schema;
}
import { MethodParam, SchemaComponents } from "@site/src/components/ParserOpenRPC/interfaces";

interface InteractiveBoxProps {
method: string;
Expand Down
22 changes: 22 additions & 0 deletions src/components/ParserOpenRPC/global.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.primaryBtn {
background: #1098FC;
color: #141618;
font-size: 14px;
line-height: 1;
font-weight: 500;
display: inline-flex;
align-items: center;
border-radius: 999px;
padding: 12px 16px;
margin-bottom: 1px;
cursor: pointer;
transition-property: 'color', 'background-color';
transition-duration: .4s;
transition-timing-function: ease;
}

.primaryBtn:hover {
text-decoration: none;
color: #fff;
background-color: #036AB5;
}
38 changes: 38 additions & 0 deletions src/components/ParserOpenRPC/interfaces.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export interface SchemaPropertyType {
name?: string;
$ref?: any;
items?: any;
title?: string;
type: string;
description?: string;
required?: boolean;
properties?: Record<string, SchemaPropertyType>;
enum?: string[];
default?: string;
schema?: Schema;
}

export interface Schema {
summary: any;
description: any;
required: boolean;
title: string;
type: string;
properties?: Record<string, SchemaPropertyType>;
items?: SchemaPropertyType;
oneOf?: SchemaPropertyType[];
allOf?: SchemaPropertyType[];
anyOf?: SchemaPropertyType[];
$ref?: string;
}

export interface MethodParam {
name: string;
description: string;
schema: Schema;
required?: boolean;
}

export interface SchemaComponents {
[key: string]: Schema;
}

0 comments on commit f5f83fd

Please sign in to comment.