-
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 #232 from oceanbase/dengfuping-dev
improve(theme): Recommend for token => useToken
- Loading branch information
Showing
16 changed files
with
120 additions
and
120 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
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
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,19 +1,23 @@ | ||
import React from 'react'; | ||
import { Spin, token } from '@oceanbase/design'; | ||
import { Spin, theme } from '@oceanbase/design'; | ||
|
||
const App: React.FC = () => ( | ||
<div | ||
style={{ | ||
margin: '20px 0', | ||
marginBottom: 20, | ||
padding: '30px 50px', | ||
textAlign: 'center', | ||
background: token.colorBgLayout, | ||
borderRadius: 4, | ||
}} | ||
> | ||
<Spin /> | ||
</div> | ||
); | ||
const App: React.FC = () => { | ||
const { token } = theme.useToken(); | ||
|
||
return ( | ||
<div | ||
style={{ | ||
margin: '20px 0', | ||
marginBottom: 20, | ||
padding: '30px 50px', | ||
textAlign: 'center', | ||
background: token.colorBgLayout, | ||
borderRadius: 4, | ||
}} | ||
> | ||
<Spin /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default App; |
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,36 +1,39 @@ | ||
import React from 'react'; | ||
import { Alert, Space, Spin, token } from '@oceanbase/design'; | ||
import { Alert, Space, Spin, theme } from '@oceanbase/design'; | ||
|
||
const containerStyle = { | ||
padding: 50, | ||
background: token.colorBgLayout, | ||
borderRadius: 4, | ||
width: 120, | ||
height: 120, | ||
}; | ||
const App: React.FC = () => { | ||
const { token } = theme.useToken(); | ||
const containerStyle = { | ||
padding: 50, | ||
background: token.colorBgLayout, | ||
borderRadius: 4, | ||
width: 120, | ||
height: 120, | ||
}; | ||
|
||
const App: React.FC = () => ( | ||
<Space direction="vertical" style={{ width: '100%' }}> | ||
<Space> | ||
<Spin tip="Loading" size="small"> | ||
<div style={containerStyle} /> | ||
</Spin> | ||
<Spin tip="Loading"> | ||
<div style={containerStyle} /> | ||
</Spin> | ||
<Spin tip="Loading" size="large"> | ||
<div style={containerStyle} /> | ||
return ( | ||
<Space direction="vertical" style={{ width: '100%' }}> | ||
<Space> | ||
<Spin tip="Loading" size="small"> | ||
<div style={containerStyle} /> | ||
</Spin> | ||
<Spin tip="Loading"> | ||
<div style={containerStyle} /> | ||
</Spin> | ||
<Spin tip="Loading" size="large"> | ||
<div style={containerStyle} /> | ||
</Spin> | ||
</Space> | ||
|
||
<Spin tip="Loading..."> | ||
<Alert | ||
message="Alert message title" | ||
description="Further details about the context of this alert." | ||
type="info" | ||
/> | ||
</Spin> | ||
</Space> | ||
|
||
<Spin tip="Loading..."> | ||
<Alert | ||
message="Alert message title" | ||
description="Further details about the context of this alert." | ||
type="info" | ||
/> | ||
</Spin> | ||
</Space> | ||
); | ||
); | ||
}; | ||
|
||
export default App; |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import theme from '../../theme'; | ||
|
||
export const useTooltipTypeList = () => { | ||
const { token } = theme.useToken(); | ||
return [ | ||
{ | ||
type: 'light', | ||
color: token.colorText, | ||
backgroundColor: token.colorBgElevated, | ||
}, | ||
{ | ||
type: 'success', | ||
color: token.colorSuccess, | ||
backgroundColor: token.colorSuccessBg, | ||
}, | ||
{ | ||
type: 'info', | ||
color: token.colorInfo, | ||
backgroundColor: token.colorInfoBg, | ||
}, | ||
{ | ||
type: 'warning', | ||
color: token.colorWarning, | ||
backgroundColor: token.colorWarningBg, | ||
}, | ||
{ | ||
type: 'error', | ||
color: token.colorError, | ||
backgroundColor: token.colorErrorBg, | ||
}, | ||
]; | ||
}; |
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
Oops, something went wrong.