mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-30 22:39:34 +08:00
fix: fix QRCode style (#39849)
* fix: fix style * snap * Update components/qrcode/style/index.ts Co-authored-by: afc163 <afc163@gmail.com> * rename className * use token Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
parent
7059f6e5ba
commit
d2d37bda21
@ -361,7 +361,9 @@ exports[`renders ./components/qrcode/demo/status.tsx extend context correctly 1`
|
||||
<div
|
||||
class="ant-qrcode-mask"
|
||||
>
|
||||
<p>
|
||||
<p
|
||||
class="ant-qrcode-expired"
|
||||
>
|
||||
QR code expired
|
||||
</p>
|
||||
<button
|
||||
|
@ -321,7 +321,9 @@ exports[`renders ./components/qrcode/demo/status.tsx correctly 1`] = `
|
||||
<div
|
||||
class="ant-qrcode-mask"
|
||||
>
|
||||
<p>
|
||||
<p
|
||||
class="ant-qrcode-expired"
|
||||
>
|
||||
QR code expired
|
||||
</p>
|
||||
<button
|
||||
|
@ -80,7 +80,7 @@ const QRCode: React.FC<QRCodeProps> = (props) => {
|
||||
{status === 'loading' && <Spin />}
|
||||
{status === 'expired' && (
|
||||
<>
|
||||
<p>{locale.expired}</p>
|
||||
<p className={`${prefixCls}-expired`}>{locale.expired}</p>
|
||||
{typeof onRefresh === 'function' && (
|
||||
<Button type="link" icon={<ReloadOutlined />} onClick={onRefresh}>
|
||||
{locale.refresh}
|
||||
|
@ -5,6 +5,7 @@ import { resetComponent } from '../../style';
|
||||
export interface ComponentToken {}
|
||||
|
||||
interface QRCodeToken extends FullToken<'QRCode'> {
|
||||
QRCodeExpiredTextColor: string;
|
||||
QRCodeMaskBackgroundColor: string;
|
||||
}
|
||||
|
||||
@ -17,6 +18,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',
|
||||
@ -38,6 +40,9 @@ const genQRCodeStyle: GenerateStyle<QRCodeToken> = (token) => {
|
||||
lineHeight: token.lineHeight,
|
||||
background: token.QRCodeMaskBackgroundColor,
|
||||
textAlign: 'center',
|
||||
[`& > ${componentCls}-expired`]: {
|
||||
color: token.QRCodeExpiredTextColor,
|
||||
},
|
||||
},
|
||||
'&-icon': {
|
||||
marginBlockEnd: token.marginXS,
|
||||
@ -53,6 +58,7 @@ const genQRCodeStyle: GenerateStyle<QRCodeToken> = (token) => {
|
||||
export default genComponentStyleHook<'QRCode'>('QRCode', (token) =>
|
||||
genQRCodeStyle(
|
||||
mergeToken<QRCodeToken>(token, {
|
||||
QRCodeExpiredTextColor: 'rgba(0, 0, 0, 0.88)',
|
||||
QRCodeMaskBackgroundColor: 'rgba(255, 255, 255, 0.96)',
|
||||
}),
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user