From ae49c6fc5683bb134f81c1319749e3adc3065f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Fri, 14 Oct 2022 14:29:06 +0200 Subject: [PATCH] Extract global layout classes into own file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rūdolfs Ošiņš --- cypress/e2e/projectHeader.spec.ts | 4 +-- cypress/support/component-index.html | 1 + index.html | 1 + public/index.css | 34 ------------------- public/layout.css | 33 ++++++++++++++++++ src/Form.svelte | 8 ++--- src/Header.svelte | 2 +- src/Modal.svelte | 2 +- src/Profile.svelte | 24 ++++++------- src/RadicleUrn.svelte | 2 +- src/SeedAddress.svelte | 2 +- src/base/projects/BranchSelector.spec.ts | 22 ++++++------ src/base/projects/BranchSelector.svelte | 10 +++--- src/base/projects/Browser.svelte | 2 +- src/base/projects/Commit.svelte | 4 +-- .../projects/Commit/CommitAuthorship.svelte | 10 +++--- src/base/projects/Commit/CommitTeaser.svelte | 2 +- src/base/projects/Issue.svelte | 8 +++-- src/base/projects/Patch.svelte | 6 ++-- src/base/projects/Patch/PatchSideBar.svelte | 2 +- src/base/projects/Widget.svelte | 4 +-- src/base/seeds/View.svelte | 19 +++-------- 22 files changed, 100 insertions(+), 102 deletions(-) create mode 100644 public/layout.css diff --git a/cypress/e2e/projectHeader.spec.ts b/cypress/e2e/projectHeader.spec.ts index 87eac9d0a..ddcd61f93 100644 --- a/cypress/e2e/projectHeader.spec.ts +++ b/cypress/e2e/projectHeader.spec.ts @@ -87,7 +87,7 @@ describe("project header", () => { cy.get("div.stat.branch") .should("have.class", "not-allowed") .should("have.text", "main"); - cy.get("div.hash.desktop").should("have.text", "56e4e02"); + cy.get("div.hash.layout-desktop").should("have.text", "56e4e02"); cy.get("div.clone-button").click(); }); @@ -134,7 +134,7 @@ describe("project header", () => { ); }); cy.get("div.stat.branch").should("have.text", "master"); - cy.get("div.hash.desktop").should("have.text", "cbf5df4"); + cy.get("div.hash.layout-desktop").should("have.text", "cbf5df4"); }); it("navigate to commit history", () => { diff --git a/cypress/support/component-index.html b/cypress/support/component-index.html index 673d0c126..959823f2a 100644 --- a/cypress/support/component-index.html +++ b/cypress/support/component-index.html @@ -6,6 +6,7 @@ + Components App diff --git a/index.html b/index.html index 66baff00b..e731ec0d8 100644 --- a/index.html +++ b/index.html @@ -19,6 +19,7 @@ + diff --git a/public/index.css b/public/index.css index 17221d7ef..4227b2e07 100644 --- a/public/index.css +++ b/public/index.css @@ -98,37 +98,3 @@ a:hover { color: var(--color-foreground); border-bottom-color: var(--color-foreground); } - -.off-centered { - height: 100%; - padding-top: 5rem; - padding-bottom: 24vh; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; -} - -.mobile, -.mobile-inline { - display: none !important; -} -.desktop { - display: block !important; -} -.desktop-inline { - display: inline !important; -} - -@media (max-width: 720px) { - .mobile { - display: block !important; - } - .mobile-inline { - display: inline !important; - } - .desktop, - .desktop-inline { - display: none !important; - } -} diff --git a/public/layout.css b/public/layout.css new file mode 100644 index 000000000..fcfdee620 --- /dev/null +++ b/public/layout.css @@ -0,0 +1,33 @@ +.layout-centered { + height: 100%; + padding-top: 5rem; + padding-bottom: 24vh; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.layout-mobile, +.layout-mobile-inline { + display: none !important; +} +.layout-desktop { + display: block !important; +} +.layout-desktop-inline { + display: inline !important; +} + +@media (max-width: 720px) { + .layout-mobile { + display: block !important; + } + .layout-mobile-inline { + display: inline !important; + } + .layout-desktop, + .layout-desktop-inline { + display: none !important; + } +} diff --git a/src/Form.svelte b/src/Form.svelte index b9dbdae17..3fce8b679 100644 --- a/src/Form.svelte +++ b/src/Form.svelte @@ -215,13 +215,13 @@ {:else if isAddress(field.value)} -
+
-
+
{:else if field.validate === "id"} -
+
{formatSeedId(field.value)}
-
+
{field.value}
{:else} diff --git a/src/Header.svelte b/src/Header.svelte index 53c42c6ee..d08187a65 100644 --- a/src/Header.svelte +++ b/src/Header.svelte @@ -209,7 +209,7 @@ {/if} -
+
diff --git a/src/Modal.svelte b/src/Modal.svelte index be5cc1fcc..9a0528d71 100644 --- a/src/Modal.svelte +++ b/src/Modal.svelte @@ -101,7 +101,7 @@
{/if} -
+