-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #887 from oceanbase/dengfuping-dev
improve(ui): ContentWithQuestion icon color
- Loading branch information
Showing
10 changed files
with
50 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,14 @@ | ||
import React from 'react'; | ||
import { ContentWithQuestion } from '@oceanbase/ui'; | ||
import './index.less'; | ||
|
||
export default () => { | ||
return ( | ||
<> | ||
<div> | ||
<ContentWithQuestion | ||
content="付费服务占比" | ||
tooltip={{ | ||
title: | ||
'登记的服务人天中有服务包归属的百分比,计算公式为 (有服务包归属的服务人天总和)/(已投入人天)', | ||
overlayStyle: { maxWidth: '330px' }, | ||
}} | ||
/> | ||
</div> | ||
<div> | ||
<ContentWithQuestion | ||
className="customer-className" | ||
content="自定义 className" | ||
tooltip={{ | ||
title: '自定义字体蓝色 className', | ||
}} | ||
/> | ||
</div> | ||
</> | ||
<ContentWithQuestion | ||
content="付费服务占比" | ||
tooltip={{ | ||
title: | ||
'登记的服务人天中有服务包归属的百分比,计算公式为 (有服务包归属的服务人天总和)/(已投入人天)', | ||
}} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { ContentWithQuestion } from '@oceanbase/ui'; | ||
import { QuestionCircleFilled } from '@oceanbase/icons'; | ||
|
||
export default () => { | ||
return ( | ||
<ContentWithQuestion | ||
content="付费服务占比" | ||
tooltip={{ | ||
title: | ||
'登记的服务人天中有服务包归属的百分比,计算公式为 (有服务包归属的服务人天总和)/(已投入人天)', | ||
}} | ||
suffixIcon={<QuestionCircleFilled />} | ||
/> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
import type { CSSObject } from '@ant-design/cssinjs'; | ||
import type { GenerateStyle } from '@oceanbase/design/es/theme'; | ||
import type { FullToken, GenerateStyle } from '@oceanbase/design/es/theme'; | ||
import { genComponentStyleHook } from '../../_util/genComponentStyleHook'; | ||
|
||
export const genContentWithQuestionStyle: GenerateStyle<any> = (token: any): CSSObject => { | ||
const { componentCls, paddingSM } = token; | ||
export type ContentWithQuestionToken = FullToken<'App'>; | ||
|
||
export const genContentWithQuestionStyle: GenerateStyle<any> = ( | ||
token: ContentWithQuestionToken | ||
): CSSObject => { | ||
const { componentCls } = token; | ||
|
||
return { | ||
[`${componentCls}-item`]: { | ||
display: 'inline-flex', | ||
alignItems: 'center', | ||
[`${componentCls}-prefix`]: { | ||
marginRight: 8, | ||
marginRight: token.marginXS, | ||
}, | ||
[`${componentCls}-suffix`]: { | ||
marginLeft: 8, | ||
marginLeft: token.marginXS, | ||
}, | ||
[`${componentCls}-help`]: { | ||
cursor: 'help', | ||
}, | ||
[`${componentCls}-color`]: { | ||
color: 'red', | ||
color: token.colorIcon, | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
export default (prefixCls: string) => { | ||
const useStyle = genComponentStyleHook('ContentWithQuestion', token => { | ||
return [genContentWithQuestionStyle(token as any)]; | ||
return [genContentWithQuestionStyle(token as ContentWithQuestionToken)]; | ||
}); | ||
return useStyle(prefixCls); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters