-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor and polish code network link
- Loading branch information
1 parent
cea5662
commit 33b5e50
Showing
3 changed files
with
153 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(ns quo.components.wallet.network-link.style) | ||
|
||
(def left-circle-container | ||
{:position :absolute | ||
:left -3}) | ||
|
||
(def right-circle-container | ||
{:position :absolute | ||
:right -3}) | ||
|
||
(def bottom-left-circle-container | ||
{:position :absolute | ||
:bottom -3 | ||
:left -3}) | ||
|
||
(def top-right-circle-container | ||
{:position :absolute | ||
:top -3 | ||
:right -3}) | ||
|
||
(def link-linear-container | ||
{:flex-direction :row | ||
:align-items :center | ||
:height 10}) | ||
|
||
(def link-1x-container | ||
{:flex 1 | ||
:height 58 | ||
:justify-content :center}) | ||
|
||
(def link-2x-container | ||
{:flex 1 | ||
:height 114 | ||
:justify-content :center}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(ns quo.components.wallet.network-link.utils) | ||
|
||
(def central-figure-width 63) | ||
|
||
(defn calculate-side-lines-path-1x | ||
"Calculates the `d` attribute for the side lines based on the SVG width." | ||
[width] | ||
(let [side-offset (/ (- width central-figure-width) 2)] | ||
{:left (str "M0 57 L" side-offset " 57") | ||
:right (str "M" (+ side-offset central-figure-width) " 1 L" width " 1")})) | ||
|
||
(defn calculate-transform | ||
"Calculates the transform attribute for the central figure based on the SVG width." | ||
[width] | ||
(let [translate-x (/ (- width central-figure-width) 2)] | ||
(str "translate(" translate-x " 0)"))) | ||
|
||
(defn calculate-side-lines-path-2x | ||
"Calculates the `d` attribute for the side lines based on the SVG width." | ||
[width] | ||
(let [side-offset (/ (- width central-figure-width) 2)] | ||
{:left (str "M0 113 L" side-offset " 113") | ||
:right (str "M" (+ side-offset central-figure-width) " 1 L" width " 1")})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters