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: fix QRCode style #39849

Merged
merged 5 commits into from Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -361,7 +361,9 @@ exports[`renders ./components/qrcode/demo/status.tsx extend context correctly 1`
<div
class="ant-qrcode-mask"
>
<p>
<p
class="expired"
>
QR code expired
</p>
<button
Expand Down
4 changes: 3 additions & 1 deletion components/qrcode/__tests__/__snapshots__/demo.test.ts.snap
Expand Up @@ -321,7 +321,9 @@ exports[`renders ./components/qrcode/demo/status.tsx correctly 1`] = `
<div
class="ant-qrcode-mask"
>
<p>
<p
class="expired"
>
QR code expired
</p>
<button
Expand Down
2 changes: 1 addition & 1 deletion components/qrcode/index.tsx
Expand Up @@ -80,7 +80,7 @@ const QRCode: React.FC<QRCodeProps> = (props) => {
{status === 'loading' && <Spin />}
{status === 'expired' && (
<>
<p>{locale.expired}</p>
<p className="expired">{locale.expired}</p>
li-jia-nan marked this conversation as resolved.
Show resolved Hide resolved
{typeof onRefresh === 'function' && (
<Button type="link" icon={<ReloadOutlined />} onClick={onRefresh}>
{locale.refresh}
Expand Down
4 changes: 4 additions & 0 deletions components/qrcode/style/index.ts
Expand Up @@ -17,6 +17,7 @@ const genQRCodeStyle: GenerateStyle<QRCodeToken> = (token) => {
justifyContent: 'center',
alignItems: 'center',
padding: token.paddingSM,
backgroundColor: token.colorWhite,
borderRadius: token.borderRadiusLG,
border: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`,
position: 'relative',
Expand All @@ -38,6 +39,9 @@ const genQRCodeStyle: GenerateStyle<QRCodeToken> = (token) => {
lineHeight: token.lineHeight,
background: token.QRCodeMaskBackgroundColor,
textAlign: 'center',
[`& > ${componentCls}-expired`]: {
color: 'rgba(0, 0, 0, 0.88)',
li-jia-nan marked this conversation as resolved.
Show resolved Hide resolved
},
},
'&-icon': {
marginBlockEnd: token.marginXS,
Expand Down