Skip to content

Commit

Permalink
fix: basic-layouts 修改侧边菜单栏阴影色
Browse files Browse the repository at this point in the history
  • Loading branch information
admin authored and admin committed May 30, 2023
1 parent 9b4dc8c commit 29fb0b5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
3 changes: 3 additions & 0 deletions packages/antdp-ui/src/ButtonGroupPro/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
}
.antdp-ButtonGroup .ant-btn{
margin: 0px 12px 0px 0px;
:last-child{
margin: 0px;
}
}
34 changes: 22 additions & 12 deletions packages/antdp-ui/src/ButtonGroupPro/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, { useEffect, useState } from 'react';
import { Button, Dropdown, Menu, Badge } from 'antd';
import { DownOutlined } from '@ant-design/icons';
import { AuthorizedBtn } from '@antdp/authorized';
import { Badge, Button, Dropdown, Menu } from 'antd';
import { ButtonProps } from 'antd/es/button';
import { ButtonGroupProps, ButtonType } from 'antd/lib/button';
import { AuthorizedBtn } from '@antdp/authorized';
import { DownOutlined } from '@ant-design/icons';
import classNames from 'classnames';
import './index.css';
import { MenuInfo } from 'rc-menu/lib/interface';
import { getMenusItems } from '../utils'
import React, { useEffect, useState } from 'react';
import { getMenusItems } from '../utils';
import './index.css';

export interface ButtonGroupProProps {
button: any[];
Expand All @@ -25,7 +25,7 @@ export interface MenusProps extends Omit<MenuInfo, 'item'> {

export interface MenusOptionProps
extends Omit<ButtonProps, 'type'>,
ButtonGroupProps {
ButtonGroupProps {
path?: string;
label?: string | React.ReactNode;
option?: MenusOptionProps[];
Expand Down Expand Up @@ -72,9 +72,12 @@ const ButtonGroupPro = (props: ButtonGroupProProps) => {
menus: MenusProps[] | undefined = [],
idx: number | undefined,
) => {
const items = getMenusItems(menus)
const items = getMenusItems(menus);
return (
<Menu items={items || []} onClick={e => handleMenuClick(menus, idx, e)} />
<Menu
items={items || []}
onClick={(e) => handleMenuClick(menus, idx, e)}
/>
);
};

Expand All @@ -90,7 +93,9 @@ const ButtonGroupPro = (props: ButtonGroupProProps) => {
onClick: item.onClick,
disabled: item.disabled,
style: {
margin: ButtonandDropdown ? '0 0 0 -3px' : '0px 12px 0px 0px',
margin: ButtonandDropdown
? '0 0 0 -3px'
: `0px ${idx === button.length - 1 ? 0 : 12}px 0px 0px`,
},
...item,
} as ButtonProps;
Expand All @@ -106,7 +111,9 @@ const ButtonGroupPro = (props: ButtonGroupProProps) => {
size="middle"
type={props.type || 'default'}
style={{
margin: ButtonandDropdown ? '0 0 0 -3px' : '0px 12px 0px 0px',
margin: ButtonandDropdown
? '0 0 0 -3px'
: `0px ${idx === button.length - 1 ? 0 : 12}px 0px 0px`,
}}
>
{menuDropdownLabel.key === idx
Expand All @@ -122,7 +129,10 @@ const ButtonGroupPro = (props: ButtonGroupProProps) => {
</Dropdown>
</div>
) : (
<Dropdown dropdownRender={() => renderMenu(item.menu, idx)} key={idx}>
<Dropdown
dropdownRender={() => renderMenu(item.menu, idx)}
key={idx}
>
{DropdownButtonDom}
</Dropdown>
);
Expand Down
4 changes: 2 additions & 2 deletions packages/basic-layouts/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body {
box-sizing: border-box;
min-height: 100%;
background-color: #001529;
box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
box-shadow: 2px 0 6px #9393930d;
overflow: auto;
z-index: 99;
.ant-layout-sider-trigger{
Expand All @@ -37,7 +37,7 @@ body {
display: flex;
position: relative;
box-sizing: border-box;
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
box-shadow: 0 0 6px 0 #9393930d;
z-index: 100;
}
.antdp-basic-layouts-header-breadcrumb {
Expand Down

0 comments on commit 29fb0b5

Please sign in to comment.