-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
130 additions
and
84 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,3 +1,4 @@ | ||
export * from './useEditorState'; | ||
export * from './useEditor'; | ||
export * from './useEditorDatasets'; | ||
export * from './useAntdToken'; |
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,28 @@ | ||
import { ConfigProvider, theme } from 'antd'; | ||
import { useContext } from 'react'; | ||
|
||
const { ConfigContext } = ConfigProvider; | ||
const useConfig = () => useContext(ConfigContext); | ||
|
||
export const useAntdToken = () => { | ||
const { getPrefixCls } = useConfig(); | ||
const rootPrefixCls = getPrefixCls(); | ||
|
||
const { useToken } = theme; | ||
const { token } = useToken(); | ||
|
||
return { | ||
...token, | ||
antCls: `.${rootPrefixCls}`, | ||
}; | ||
}; | ||
|
||
export const usePrefixCls = ( | ||
tag?: string, | ||
props?: { | ||
prefixCls?: string; | ||
}, | ||
) => { | ||
const prefix = props?.prefixCls ?? 'li-'; | ||
return `${prefix}${tag ?? ''}`; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import { css } from '@emotion/css'; | ||
import { useAntdToken } from '../hooks'; | ||
|
||
const useStyle = () => { | ||
const { colorBgContainer, colorSplit, colorText, colorTextSecondary, borderRadius } = useAntdToken(); | ||
|
||
return { | ||
editorLayout: css` | ||
position: relative; | ||
display: flex; | ||
/* 滚动条整体部分,必须要设置 */ | ||
::-webkit-scrollbar { | ||
width: 7px; | ||
height: 7px; | ||
appearance: none; | ||
} | ||
/* 滚动条的滑块按钮 */ | ||
::-webkit-scrollbar-thumb { | ||
background: ${colorSplit}; | ||
border-radius: 3px; | ||
cursor: pointer; | ||
&:hover { | ||
background-color: ${colorSplit}; | ||
} | ||
} | ||
/* 滚动条的轨道 */ | ||
::-webkit-scrollbar-track { | ||
background: none; | ||
border-radius: 0; | ||
} | ||
`, | ||
|
||
loading: css` | ||
position: absolute; | ||
top: 30px; | ||
left: 50%; | ||
z-index: 10; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-around; | ||
width: 180px; | ||
margin-left: 50px; | ||
padding: 15px; | ||
color: ${colorTextSecondary}; | ||
background-color: ${colorBgContainer}; | ||
border-radius: ${borderRadius}; | ||
`, | ||
|
||
left: css` | ||
position: relative; | ||
display: flex; | ||
color: ${colorText}; | ||
`, | ||
|
||
sideNav: css` | ||
z-index: 2; | ||
`, | ||
|
||
sidePanel: css` | ||
z-index: 1; | ||
width: 350px; | ||
transition: width 50ms ease 0s; | ||
&_hidden { | ||
width: 0; | ||
visibility: hidden; | ||
} | ||
`, | ||
|
||
sidePanelHidden: css` | ||
width: 0; | ||
visibility: hidden; | ||
`, | ||
|
||
cavans: css` | ||
flex: 1; | ||
overflow: hidden; | ||
text-align: center; | ||
transition: width 50ms ease 0s; | ||
`, | ||
}; | ||
}; | ||
|
||
export default useStyle; |