Remove Button divider (#2899)
This commit is contained in:
parent
bf3207750f
commit
51d7cd9a0b
@ -1,17 +0,0 @@
|
||||
// Copyright 2017-2020 @polkadot/react-components authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { DividerProps } from './types';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { classes } from '../util';
|
||||
|
||||
function ButtonDivider ({ className = '' }: DividerProps): React.ReactElement<DividerProps> {
|
||||
return (
|
||||
<div className={classes('ui button compact mini basic', className)} />
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(ButtonDivider);
|
||||
@ -2,32 +2,26 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { GroupProps, GroupType } from './types';
|
||||
import { GroupProps } from './types';
|
||||
|
||||
import React from 'react';
|
||||
import SUIButton from 'semantic-ui-react/dist/commonjs/elements/Button/Button';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import Divider from './Divider';
|
||||
|
||||
function ButtonGroup ({ children, className = '', isBasic, isCentered }: GroupProps): React.ReactElement<GroupProps> {
|
||||
return (
|
||||
<div className={`ui--Button-Group ${isCentered ? 'centered' : ''} ${className}`}>
|
||||
<div className={`${className} ui--Button-Group ${isCentered ? 'centered' : ''}`}>
|
||||
<SUIButton.Group
|
||||
basic={isBasic}
|
||||
size='small'
|
||||
>
|
||||
{isBasic
|
||||
? null
|
||||
: <Divider className='ui--Button-Group-Divider' />
|
||||
}
|
||||
{children}
|
||||
</SUIButton.Group>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const Memo = React.memo(styled(ButtonGroup)`
|
||||
export default React.memo(styled(ButtonGroup)`
|
||||
text-align: right;
|
||||
|
||||
:not(:first-child) {
|
||||
@ -46,12 +40,4 @@ const Memo = React.memo(styled(ButtonGroup)`
|
||||
&+.ui--Table {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.ui--Buttn-Group-Divider {
|
||||
padding: 0;
|
||||
}
|
||||
`) as unknown as GroupType;
|
||||
|
||||
Memo.Divider = Divider;
|
||||
|
||||
export default Memo;
|
||||
`);
|
||||
|
||||
@ -6,13 +6,11 @@ import { ButtonType } from './types';
|
||||
|
||||
import IButton from './Button';
|
||||
import Content from './Content';
|
||||
import Divider from './Divider';
|
||||
import Group from './Group';
|
||||
|
||||
const Button = IButton as unknown as ButtonType;
|
||||
|
||||
Button.Content = Content;
|
||||
Button.Divider = Divider;
|
||||
Button.Group = Group;
|
||||
|
||||
export default Button;
|
||||
|
||||
@ -46,13 +46,8 @@ export interface GroupProps extends BareProps {
|
||||
isCentered?: boolean;
|
||||
}
|
||||
|
||||
export type GroupType = React.ComponentType<GroupProps> & {
|
||||
Divider: React.ComponentType<DividerProps>;
|
||||
};
|
||||
|
||||
export type ButtonType = React.ComponentType<ButtonProps> & {
|
||||
Content: React.ComponentType<ContentProps>;
|
||||
Divider: React.ComponentType<DividerProps>;
|
||||
Group: GroupType;
|
||||
Group: React.ComponentType<GroupProps>;
|
||||
Or: React.ComponentType<BareProps>;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user