blob: 3129abcbb220c189393d9a5935dc38aef9c85128 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
import React from 'react';
import styled from 'styled-components';
const SIDE_BUTTON_WIDTH = 44;
const ButtonRow = styled.div({
display: 'flex',
flexDirection: 'row',
});
const MainButton = styled.button({
display: 'flex',
flex: 1,
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
});
const SideButton = styled.button({
display: 'flex',
borderTopLeftRadius: 0,
borderBottomLeftRadius: 0,
width: SIDE_BUTTON_WIDTH,
marginLeft: '1px !important',
});
export interface MultiButtonCompatibleProps {
className?: string;
textOffset?: number;
}
interface IMultiButtonProps {
mainButton: React.ComponentType<MultiButtonCompatibleProps>;
sideButton: React.ComponentType<MultiButtonCompatibleProps>;
}
export function MultiButton(props: IMultiButtonProps) {
return (
<ButtonRow>
<MainButton as={props.mainButton} textOffset={SIDE_BUTTON_WIDTH + 1} />
<SideButton as={props.sideButton} />
</ButtonRow>
);
}
|