From 11bc9aad25763d5fe5f1fcdf90350dba2b053093 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Tue, 7 Jun 2022 22:36:17 -0400 Subject: [PATCH 1/4] Clean up styling on doc content container --- frontend/src/app/docs/api-docs/api-docs.component.scss | 1 - frontend/src/app/docs/docs/docs.component.html | 2 +- frontend/src/app/docs/docs/docs.component.scss | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/docs/api-docs/api-docs.component.scss b/frontend/src/app/docs/api-docs/api-docs.component.scss index 91c85c346..4841601ab 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.scss +++ b/frontend/src/app/docs/api-docs/api-docs.component.scss @@ -205,7 +205,6 @@ h3 { .doc-content { width: 100%; - margin-top: -20px; float: unset; } diff --git a/frontend/src/app/docs/docs/docs.component.html b/frontend/src/app/docs/docs/docs.component.html index 30692cc42..f74cbd134 100644 --- a/frontend/src/app/docs/docs/docs.component.html +++ b/frontend/src/app/docs/docs/docs.component.html @@ -34,7 +34,7 @@ -
+

diff --git a/frontend/src/app/docs/docs/docs.component.scss b/frontend/src/app/docs/docs/docs.component.scss index 6398c5602..907c29fd8 100644 --- a/frontend/src/app/docs/docs/docs.component.scss +++ b/frontend/src/app/docs/docs/docs.component.scss @@ -1,6 +1,6 @@ #main-tab-content { text-align: left; - padding-top: 10px; + padding-top: 1rem; scroll-behavior: smooth; } From 9ca7904b1b3e8587c1c40d6ca5644ebfa10e1b07 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Tue, 7 Jun 2022 22:52:08 -0400 Subject: [PATCH 2/4] Add note on api limits --- frontend/src/app/docs/api-docs/api-docs.component.html | 3 ++- frontend/src/app/docs/api-docs/api-docs.component.scss | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/docs/api-docs/api-docs.component.html b/frontend/src/app/docs/api-docs/api-docs.component.html index d25a60653..91d10a72f 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.html +++ b/frontend/src/app/docs/api-docs/api-docs.component.html @@ -34,7 +34,8 @@
-

Reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} API service.

+

Reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} API service.

+

Note that we enforce rate limits. If you exceed these limits, you will get a polite error encouraging you to run your own Mempool instance. If you repeatedly exceed the limits, you may be banned from accessing the service altogether.

{{ item.title }}

diff --git a/frontend/src/app/docs/api-docs/api-docs.component.scss b/frontend/src/app/docs/api-docs/api-docs.component.scss index 4841601ab..1729a7dbd 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.scss +++ b/frontend/src/app/docs/api-docs/api-docs.component.scss @@ -199,6 +199,10 @@ h3 { @media (max-width: 992px) { + h3 { + margin: 1.5rem 0 0 0; + } + .hide-on-mobile { display: none; } @@ -237,6 +241,10 @@ h3 { opacity: 0; transition: 0.5s opacity ease; } + + .api-note { + font-size: 0.85rem; + } } @media (min-width: 992px) { From 9527b3e0a4cdc7f6b5b4f71a81d584a61a561855 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Tue, 7 Jun 2022 22:55:29 -0400 Subject: [PATCH 3/4] Make rest api doc section welcomer full sentence --- frontend/src/app/docs/api-docs/api-docs.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/docs/api-docs/api-docs.component.html b/frontend/src/app/docs/api-docs/api-docs.component.html index 91d10a72f..42de7dfef 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.html +++ b/frontend/src/app/docs/api-docs/api-docs.component.html @@ -34,7 +34,7 @@
-

Reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} API service.

+

Below is a reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} REST API service.

Note that we enforce rate limits. If you exceed these limits, you will get a polite error encouraging you to run your own Mempool instance. If you repeatedly exceed the limits, you may be banned from accessing the service altogether.

From c73d0599652ebb01940aa7cc65492369858ca305 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Tue, 7 Jun 2022 23:27:35 -0400 Subject: [PATCH 4/4] Show rate limiting note on official instances only Also fix some styling flaws resulting from hiding the rate limiting text. --- frontend/src/app/docs/api-docs/api-docs.component.html | 4 ++-- frontend/src/app/docs/api-docs/api-docs.component.scss | 8 ++++++-- frontend/src/app/docs/api-docs/api-docs.component.ts | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/docs/api-docs/api-docs.component.html b/frontend/src/app/docs/api-docs/api-docs.component.html index 42de7dfef..f73de31c7 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.html +++ b/frontend/src/app/docs/api-docs/api-docs.component.html @@ -34,8 +34,8 @@
-

Below is a reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} REST API service.

-

Note that we enforce rate limits. If you exceed these limits, you will get a polite error encouraging you to run your own Mempool instance. If you repeatedly exceed the limits, you may be banned from accessing the service altogether.

+

Below is a reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} REST API service.

+

Note that we enforce rate limits. If you exceed these limits, you will get a polite error encouraging you to run your own Mempool instance. If you repeatedly exceed the limits, you may be banned from accessing the service altogether.

{{ item.title }}

diff --git a/frontend/src/app/docs/api-docs/api-docs.component.scss b/frontend/src/app/docs/api-docs/api-docs.component.scss index 1729a7dbd..456983657 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.scss +++ b/frontend/src/app/docs/api-docs/api-docs.component.scss @@ -22,10 +22,14 @@ li.nav-item { } } -.no-bottom-space { +.doc-welcome-note { margin-bottom: 0; } +.api-note { + margin-top: 1rem; +} + .nav-tabs .nav-link.active { border-bottom: 1px solid #fff; @media (min-width: 676px){ @@ -242,7 +246,7 @@ h3 { transition: 0.5s opacity ease; } - .api-note { + .doc-welcome-note { font-size: 0.85rem; } } diff --git a/frontend/src/app/docs/api-docs/api-docs.component.ts b/frontend/src/app/docs/api-docs/api-docs.component.ts index 0041fa8cd..94eccd4e2 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.ts +++ b/frontend/src/app/docs/api-docs/api-docs.component.ts @@ -23,6 +23,7 @@ export class ApiDocsComponent implements OnInit { restDocs: any[]; wsDocs: any; screenWidth: number; + officialMempoolInstance: boolean; constructor( private stateService: StateService, @@ -43,6 +44,7 @@ export class ApiDocsComponent implements OnInit { ngOnInit(): void { this.env = this.stateService.env; + this.officialMempoolInstance = this.env.OFFICIAL_MEMPOOL_SPACE; this.network$ = merge(of(''), this.stateService.networkChanged$).pipe( tap((network: string) => { if (this.env.BASE_MODULE === 'mempool' && network !== '') {