Skip to content

Commit 75cce27

Browse files
committed
Merge pull request 'fix: popupConfirm paddingTop UI;loading-spinner UI roundCorner' (#94) from popupconfirm_loadingspiner_UI into main
Reviewed-on: https://git.biggo.com/john/dive/pulls/94
2 parents b864550 + f93f243 commit 75cce27

File tree

5 files changed

+43
-19
lines changed

5 files changed

+43
-19
lines changed

src/components/PopupConfirm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const CancelButton = () => {
101101

102102
return (
103103
<PopupWindow {...windowProps}>
104-
<div className={`popup-confirm ${noBorder ? "no-border" : ""} ${className || ""}`}>
104+
<div className={`popup-confirm ${noBorder && "no-border"} ${noBorder && !(title && children) && "popup-confirm-top"} ${className || ""}`}>
105105
{showClose && (
106106
<div className="close-btn" onClick={onClickOutside}>
107107
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">

src/styles/_variables.scss

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ $shadow-dark: 0 2px 6px rgba(0, 0, 0, 0.2);
134134
--stroke-extremestrong: #000000;
135135
--stroke-op-dark-extremestrong: rgba(0, 0, 0, 0.7);
136136
--stroke-neg-medium: #f62257;
137+
--stroke-success: #52c41a;
137138
--stroke-pri-purple: #9200FB;
138139
--filter-dark: brightness(300%);
139140

@@ -260,6 +261,7 @@ $shadow-dark: 0 2px 6px rgba(0, 0, 0, 0.2);
260261
--stroke-light-extremestrong: #fff;
261262
--stroke-extremestrong: #ffffff;
262263
--stroke-op-dark-extremestrong: rgba(255, 255, 255, 0.7);
264+
--stroke-success: #52c41a;
263265
--stroke-neg-medium: #d11040;
264266
--stroke-pri-purple: #9200FB;
265267
--filter-dark: invert(27%) brightness(300%);
@@ -322,22 +324,41 @@ $z-sidebar: 200;
322324
}
323325
}
324326

325-
@mixin loading-spinner($size: 16px, $border-width: 2px) {
327+
@mixin loading-spinner($size: 16px, $border-width: 2px, $color: var(--text-inverted), $bg-color: var(--border-inverted-op-mediumweak)) {
326328
width: $size;
327329
height: $size;
328-
border: $border-width solid var(--border-inverted-op-mediumweak);
329330
border-radius: 50%;
330-
border-top-color: var(--text-inverted);
331+
position: relative;
331332
animation: spin 0.8s linear infinite;
332-
}
333+
background: conic-gradient(
334+
$color 0deg 90deg,
335+
$bg-color 90deg 360deg
336+
);
337+
-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - $border-width), black 0);
338+
mask: radial-gradient(farthest-side, transparent calc(100% - $border-width), black 0);
339+
340+
&::before,
341+
&::after {
342+
content: "";
343+
position: absolute;
344+
width: $border-width;
345+
height: $border-width;
346+
border-radius: 50%;
347+
background: $color;
348+
transform: translate(-50%, -50%);
349+
}
333350

334-
@mixin loading-spinner-dark($size: 16px, $border-width: 2px) {
335-
width: $size;
336-
height: $size;
337-
border: $border-width solid var(--border-op-mediumweak);
338-
border-radius: 50%;
339-
border-top-color: var(--text);
340-
animation: spin 0.8s linear infinite;
351+
&::before {
352+
top: 50%;
353+
left: 50%;
354+
transform: translate(-50%, -50%) rotate(0deg) translate(calc($size / 2) - calc($border-width / 2));
355+
}
356+
357+
&::after {
358+
top: -50%;
359+
left: 50%;
360+
transform: translate(-50%, 50%) rotate(90deg) translate(calc($size / 2) - calc($border-width / 2));
361+
}
341362
}
342363

343364
// text line clamp

src/styles/components/_Button.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
&.white,
2727
&.gray {
2828
.loading-spinner {
29-
@include loading-spinner-dark;
29+
@include loading-spinner(16px, 2px, var(--text), var(--border-op-mediumweak));
3030
}
3131
}
3232

src/styles/components/_PopupConfirm.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
max-height: 85vh;
1717
overflow: hidden;
1818

19+
&.popup-confirm-top {
20+
.popup-confirm-header,
21+
.popup-confirm-content {
22+
padding-top: 36px;
23+
}
24+
}
25+
1926
&.no-border {
2027
.popup-confirm-header,
2128
.popup-confirm-footer {

src/styles/overlay/_Model.scss

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,6 @@
425425
}
426426

427427
.models-delete-confirm {
428-
.popup-confirm-content {
429-
padding-bottom: 0px;
430-
}
431-
432428
.models-delete-confirm-content {
433429
display: flex;
434430
flex-direction: column;
@@ -457,7 +453,7 @@
457453
height: 100%;
458454

459455
&.edit{
460-
padding: 20px 86px 0 62px;
456+
padding: 0 86px 0 62px;
461457

462458
.title{
463459
font-weight: 700 !important;
@@ -793,7 +789,7 @@
793789
gap: 5px;
794790

795791
.loading-spinner {
796-
@include loading-spinner-dark;
792+
@include loading-spinner(16px, 2px, var(--text), var(--border-op-mediumweak));
797793
width: 22px;
798794
height: 22px;
799795
}

0 commit comments

Comments
 (0)