Skip to content

Commit

Permalink
fix(layout): update drawer style
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Nov 25, 2022
1 parent 3e06527 commit eb7ace8
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ const LayoutSetting: React.FC<{
settings: Partial<ProSettings>;
changeSetting: (key: string, value: any, hideLoading?: boolean) => void;
hashId: string;
}> = ({ settings = {}, changeSetting, hashId }) => {
prefixCls: string;
}> = ({ settings = {}, prefixCls, changeSetting, hashId }) => {
const formatMessage = getFormatMessage();
const { contentWidth, splitMenus, fixedHeader, layout, fixSiderbar } =
settings || defaultSettings;

return (
<List
className={`${prefixCls}-list ${hashId}`}
split={false}
dataSource={[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ const RegionalSetting: React.FC<{
settings: Partial<ProSettings>;
changeSetting: (key: string, value: any, hideLoading?: boolean) => void;
hashId: string;
}> = ({ settings = {}, changeSetting, hashId }) => {
prefixCls: string;
}> = ({ settings = {}, prefixCls, changeSetting, hashId }) => {
const formatMessage = getFormatMessage();
const regionalSetting = ['header', 'footer', 'menu', 'menuHeader'];
return (
<List
className={`${prefixCls}-list ${hashId}`}
split={false}
renderItem={renderLayoutSettingItem}
dataSource={regionalSetting.map((key) => {
Expand Down
5 changes: 4 additions & 1 deletion packages/layout/src/components/SettingDrawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type MergerSettingsType<T> = Partial<T> & {
};

const Body: React.FC<BodyProps> = ({ children, hashId, prefixCls, title }) => (
<div style={{ marginBlockEnd: 24 }}>
<div style={{ marginBlockEnd: 12 }}>
<h3 className={`${prefixCls}-body-title ${hashId}`}>{title}</h3>
{children}
</div>
Expand Down Expand Up @@ -468,6 +468,7 @@ export const SettingDrawer: React.FC<SettingDrawerProps> = (props) => {
</Body>
) : null}
<LayoutSetting
prefixCls={baseClassName}
hashId={hashId}
settings={settingState}
changeSetting={changeSetting}
Expand All @@ -481,6 +482,7 @@ export const SettingDrawer: React.FC<SettingDrawerProps> = (props) => {
>
<RegionalSetting
hashId={hashId}
prefixCls={baseClassName}
settings={settingState}
changeSetting={changeSetting}
/>
Expand All @@ -494,6 +496,7 @@ export const SettingDrawer: React.FC<SettingDrawerProps> = (props) => {
title={formatMessage({ id: 'app.setting.othersettings' })}
>
<List
className={`${baseClassName}-list ${hashId}`}
split={false}
size="small"
renderItem={renderLayoutSettingItem}
Expand Down
12 changes: 9 additions & 3 deletions packages/layout/src/components/SettingDrawer/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ const genSettingDrawerStyle: GenerateStyle<SettingDrawerToken> = (token) => {
[token.componentCls]: {
'&-content': { position: 'relative', minHeight: '100%', color: token.colorText },
'&-body-title': {
marginBlockEnd: '12px',
marginBlock: token.marginXS,
fontSize: '14px',
lineHeight: '22px',
color: token.colorTextHeading,
},
'&-block-checkbox': {
display: 'flex',
minHeight: 42,
gap: 12,
'& &-item': {
position: 'relative',
width: '44px',
height: '36px',
marginInlineEnd: '16px',
overflow: 'hidden',
borderRadius: '4px',
boxShadow: '0 1px 2.5px 0 rgba(0, 0, 0, 0.18)',
boxShadow: token.boxShadowCard,
cursor: 'pointer',
fontSize: 56,
lineHeight: '56px',
Expand Down Expand Up @@ -123,6 +123,12 @@ const genSettingDrawerStyle: GenerateStyle<SettingDrawerToken> = (token) => {
cursor: 'pointer',
},
},
'&-list': {
[`li${token.antCls}-list-item`]: {
paddingInline: 0,
paddingBlock: 8,
},
},
},
};
};
Expand Down
Loading

0 comments on commit eb7ace8

Please sign in to comment.