Skip to content

Commit 09056d3

Browse files
committed
resolve conflicts
2 parents d0d4fa6 + d080634 commit 09056d3

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

src/components/Button/index.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,14 @@ a.#{$baseClass} {
157157
object-position: 50% 50%;
158158
margin-right: 5px;
159159
}
160+
161+
.vant-icon__container {
162+
margin-right: 5px;
163+
}
164+
165+
&__onlyIcon {
166+
.vant-icon__container {
167+
margin-right: 0px;
168+
}
169+
}
160170
}

src/components/Button/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ export default function Button({
4646
{ square },
4747
{ block },
4848
{ hairline },
49-
{ [size]: size }
49+
{ [size]: size },
50+
{ onlyIcon: !text && !children }
5051
]),
5152
style: {}
5253
};

src/components/Field/index.stories.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export const FieldEvents = () => {
9797
export const FieldRef = () => {
9898
const [containerRef, setContainerRef] = useState(null);
9999
const [fieldRef, setFieldRef] = useState(null);
100+
const [clickOutside, setClickOutside] = useState(false);
100101

101102
window.addEventListener('click', (e) => {
102103
if (
@@ -106,7 +107,9 @@ export const FieldRef = () => {
106107
// @ts-ignore: Object is possibly 'null'.
107108
!containerRef.current.contains(e.target)
108109
) {
109-
alert('Click outside of container detected');
110+
setClickOutside(true);
111+
} else {
112+
setClickOutside(false);
110113
}
111114
});
112115

@@ -127,6 +130,7 @@ export const FieldRef = () => {
127130
}
128131
</p>
129132
<Field
133+
placeholder={`Click outside? ${clickOutside}`}
130134
leftIcon='music-o'
131135
rightIcon='success'
132136
getContainerRef={(ref) => setContainerRef(ref)}

src/styles/stories.scss

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
body {
44
margin: 0;
5-
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica,
6-
Segoe UI, Arial, Roboto, 'PingFang SC', 'Hiragino Sans GB',
7-
'Microsoft Yahei', sans-serif;
5+
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC',
6+
'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
87
}
98

109
.container {
@@ -24,14 +23,19 @@ body {
2423
margin-bottom: 20px;
2524
margin-right: 20px;
2625
}
26+
i {
27+
margin-right: 5px;
28+
}
2729
}
2830

2931
&.column {
3032
flex-direction: column;
3133
}
3234

33-
&.icon i {
34-
margin-right: 5px;
35+
&.icon {
36+
i {
37+
margin-right: 5px;
38+
}
3539
}
3640

3741
nav {
@@ -41,10 +45,6 @@ body {
4145
margin: 0;
4246
}
4347
}
44-
45-
.vant-button {
46-
margin-right: 20px;
47-
}
4848
}
4949

5050
.icons-container {

0 commit comments

Comments
 (0)