Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: button with icon and inline (#2742) #2822

Merged
merged 1 commit into from
Sep 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions components/button/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,44 @@ exports[`renders ./components/button/demo/basic.md correctly 1`] = `
<div
class="am-whitespace am-whitespace-md"
/>
<a
aria-disabled="false"
class="am-button am-button-small am-button-inline am-button-icon"
role="button"
style="margin-right:4px"
>
<svg
aria-hidden="true"
class="am-button-icon am-icon am-icon-check-circle-o am-icon-xxs"
>
<use
href="#check-circle-o"
/>
</svg>
<span>
with icon and inline
</span>
</a>
<a
aria-disabled="false"
class="am-button am-button-small am-button-inline am-button-icon"
role="button"
>
<svg
aria-hidden="true"
class="am-button-icon am-icon am-icon-check-circle-o am-icon-xxs"
>
<use
href="#check-circle-o"
/>
</svg>
<span>
with icon and inline
</span>
</a>
<div
class="am-whitespace am-whitespace-md"
/>
<div
class="am-whitespace am-whitespace-md"
/>
Expand Down
3 changes: 3 additions & 0 deletions components/button/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const ButtonExample = () => (
<Button loading>loading button</Button><WhiteSpace />
<Button icon="check-circle-o">with icon</Button><WhiteSpace />
<Button icon={<img src="https://gw.alipayobjects.com/zos/rmsportal/jBfVSpDwPbitsABtDDlB.svg" alt="" />}>with custom icon</Button><WhiteSpace />
<Button icon="check-circle-o" inline size="small" style={{ marginRight: '4px' }}>with icon and inline</Button>
<Button icon="check-circle-o" inline size="small">with icon and inline</Button>
<WhiteSpace />

{/* <Button activeStyle={false}>无点击反馈</Button><WhiteSpace /> */}
{/* <Button activeStyle={{ backgroundColor: 'red' }}>custom feedback style</Button><WhiteSpace /> */}
Expand Down
3 changes: 3 additions & 0 deletions components/button/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
&-inline {
display: inline-block;
padding: 0 @h-spacing-lg;
&.@{buttonPrefixCls}-icon {
display: inline-flex;
}
}

&-small {
Expand Down