mirror of
https://github.com/apotdevin/thunderhub.git
synced 2025-02-22 22:25:21 +01:00
chore: more button changes
This commit is contained in:
parent
73c91e8993
commit
dfe1cc32ec
4 changed files with 44 additions and 39 deletions
|
@ -5,7 +5,6 @@ import {
|
||||||
colorButtonBackground,
|
colorButtonBackground,
|
||||||
disabledButtonBackground,
|
disabledButtonBackground,
|
||||||
disabledButtonBorder,
|
disabledButtonBorder,
|
||||||
colorButtonSelectedBorder,
|
|
||||||
inverseTextColor,
|
inverseTextColor,
|
||||||
colorButtonBorder,
|
colorButtonBorder,
|
||||||
} from '../../../styles/Themes';
|
} from '../../../styles/Themes';
|
||||||
|
@ -31,29 +30,30 @@ const StyledArrow = styled.div`
|
||||||
|
|
||||||
interface BorderProps {
|
interface BorderProps {
|
||||||
borderColor?: string;
|
borderColor?: string;
|
||||||
withHover?: boolean;
|
|
||||||
selected?: boolean;
|
selected?: boolean;
|
||||||
withMargin?: string;
|
withMargin?: string;
|
||||||
|
withBorder?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BorderButton = styled(GeneralButton)`
|
const BorderButton = styled(GeneralButton)`
|
||||||
margin: ${({ withMargin }) => (withMargin ? withMargin : '0')};
|
margin: ${({ withMargin }) => (withMargin ? withMargin : '0')};
|
||||||
${({ selected }) => selected && `cursor: default`};
|
${({ selected }) => selected && `cursor: default`};
|
||||||
${({ selected }) => selected && `font-weight: 900`};
|
${({ selected }) => selected && `font-weight: 900`};
|
||||||
border: none;
|
|
||||||
background-color: ${colorButtonBackground};
|
background-color: ${colorButtonBackground};
|
||||||
color: ${textColor};
|
color: ${textColor};
|
||||||
border: 1px solid
|
border: 1px solid
|
||||||
${({ borderColor, withHover, selected }: BorderProps) =>
|
${({ borderColor, selected, withBorder }: BorderProps) =>
|
||||||
(borderColor && !withHover) || selected
|
withBorder
|
||||||
? selected
|
? borderColor
|
||||||
? colorButtonSelectedBorder
|
? borderColor
|
||||||
: borderColor
|
: colorButtonBorder
|
||||||
|
: selected
|
||||||
|
? colorButtonBorder
|
||||||
: colorButtonBackground};
|
: colorButtonBackground};
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
${({ borderColor, withHover, selected }: BorderProps) =>
|
${({ borderColor, selected }: BorderProps) =>
|
||||||
withHover && !selected
|
!selected
|
||||||
? css`
|
? css`
|
||||||
border: 1px solid ${colorButtonBackground};
|
border: 1px solid ${colorButtonBackground};
|
||||||
background-color: ${borderColor
|
background-color: ${borderColor
|
||||||
|
@ -85,9 +85,9 @@ interface ColorButtonProps {
|
||||||
children?: any;
|
children?: any;
|
||||||
selected?: boolean;
|
selected?: boolean;
|
||||||
arrow?: boolean;
|
arrow?: boolean;
|
||||||
withHover?: boolean;
|
|
||||||
onClick?: any;
|
onClick?: any;
|
||||||
withMargin?: string;
|
withMargin?: string;
|
||||||
|
withBorder?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ColorButton = ({
|
export const ColorButton = ({
|
||||||
|
@ -96,8 +96,8 @@ export const ColorButton = ({
|
||||||
children,
|
children,
|
||||||
selected,
|
selected,
|
||||||
arrow,
|
arrow,
|
||||||
withHover = true,
|
|
||||||
withMargin,
|
withMargin,
|
||||||
|
withBorder,
|
||||||
onClick,
|
onClick,
|
||||||
}: ColorButtonProps) => {
|
}: ColorButtonProps) => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
|
@ -112,10 +112,10 @@ export const ColorButton = ({
|
||||||
return (
|
return (
|
||||||
<BorderButton
|
<BorderButton
|
||||||
borderColor={color}
|
borderColor={color}
|
||||||
withHover={withHover}
|
|
||||||
selected={selected}
|
selected={selected}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
withMargin={withMargin}
|
withMargin={withMargin}
|
||||||
|
withBorder={withBorder}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
{arrow && renderArrow()}
|
{arrow && renderArrow()}
|
||||||
|
|
|
@ -9,7 +9,6 @@ import {
|
||||||
SubTitle,
|
SubTitle,
|
||||||
NoWrapTitle,
|
NoWrapTitle,
|
||||||
Sub4Title,
|
Sub4Title,
|
||||||
ColorButton,
|
|
||||||
} from '../generic/Styled';
|
} from '../generic/Styled';
|
||||||
import { Circle, AlertTriangle } from '../generic/Icons';
|
import { Circle, AlertTriangle } from '../generic/Icons';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
@ -19,6 +18,7 @@ import { getErrorContent } from '../../utils/error';
|
||||||
import { GET_BITCOIN_FEES } from '../../graphql/query';
|
import { GET_BITCOIN_FEES } from '../../graphql/query';
|
||||||
import { useSettings } from '../../context/SettingsContext';
|
import { useSettings } from '../../context/SettingsContext';
|
||||||
import { SecureButton } from '../buttons/secureButton/SecureButton';
|
import { SecureButton } from '../buttons/secureButton/SecureButton';
|
||||||
|
import { ColorButton } from '../buttons/colorButton/ColorButton';
|
||||||
|
|
||||||
interface CloseChannelProps {
|
interface CloseChannelProps {
|
||||||
setModalOpen: (status: boolean) => void;
|
setModalOpen: (status: boolean) => void;
|
||||||
|
@ -118,7 +118,7 @@ export const CloseChannel = ({
|
||||||
text: string,
|
text: string,
|
||||||
selected: boolean,
|
selected: boolean,
|
||||||
) => (
|
) => (
|
||||||
<ColorButton color={textColorMap[theme]} onClick={onClick}>
|
<ColorButton onClick={onClick} withMargin={'4px'} withBorder={true}>
|
||||||
<Circle
|
<Circle
|
||||||
size={'10px'}
|
size={'10px'}
|
||||||
fillcolor={selected ? textColorMap[theme] : ''}
|
fillcolor={selected ? textColorMap[theme] : ''}
|
||||||
|
@ -152,9 +152,9 @@ export const CloseChannel = ({
|
||||||
Close Channel
|
Close Channel
|
||||||
</SecureButton>
|
</SecureButton>
|
||||||
</div>
|
</div>
|
||||||
<Button color={'green'} onClick={handleOnlyClose}>
|
<ColorButton color={'green'} onClick={handleOnlyClose}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</ColorButton>
|
||||||
</SingleLine>
|
</SingleLine>
|
||||||
</WarningCard>
|
</WarningCard>
|
||||||
);
|
);
|
||||||
|
@ -217,7 +217,6 @@ export const CloseChannel = ({
|
||||||
: 'Fee (Sats/Byte)'}
|
: 'Fee (Sats/Byte)'}
|
||||||
</NoWrapTitle>
|
</NoWrapTitle>
|
||||||
<SmallInput
|
<SmallInput
|
||||||
color={textColorMap[theme]}
|
|
||||||
min={1}
|
min={1}
|
||||||
type={'number'}
|
type={'number'}
|
||||||
onChange={e => setAmount(parseInt(e.target.value))}
|
onChange={e => setAmount(parseInt(e.target.value))}
|
||||||
|
@ -233,12 +232,22 @@ export const CloseChannel = ({
|
||||||
</SingleLine>
|
</SingleLine>
|
||||||
<Separation />
|
<Separation />
|
||||||
<CenterLine>
|
<CenterLine>
|
||||||
<Button color={'red'} onClick={() => setIsConfirmed(true)}>
|
<ColorButton
|
||||||
Close Channel
|
withMargin={'4px'}
|
||||||
</Button>
|
withBorder={true}
|
||||||
<Button color={textColorMap[theme]} onClick={handleOnlyClose}>
|
onClick={handleOnlyClose}
|
||||||
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</ColorButton>
|
||||||
|
<ColorButton
|
||||||
|
arrow={true}
|
||||||
|
withMargin={'4px'}
|
||||||
|
withBorder={true}
|
||||||
|
color={'red'}
|
||||||
|
onClick={() => setIsConfirmed(true)}
|
||||||
|
>
|
||||||
|
Close Channel
|
||||||
|
</ColorButton>
|
||||||
</CenterLine>
|
</CenterLine>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -36,11 +36,6 @@ export const colorButtonBorder = theme('mode', {
|
||||||
dark: '#6E7ACC',
|
dark: '#6E7ACC',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const colorButtonSelectedBorder = theme('mode', {
|
|
||||||
light: '#99BAFF',
|
|
||||||
dark: '#6E7ACC',
|
|
||||||
});
|
|
||||||
|
|
||||||
export const disabledButtonBackground = theme('mode', {
|
export const disabledButtonBackground = theme('mode', {
|
||||||
light: '#f5f5f5',
|
light: '#f5f5f5',
|
||||||
dark: 'rgba(0,0,0,0.4)',
|
dark: 'rgba(0,0,0,0.4)',
|
||||||
|
|
|
@ -12,8 +12,8 @@ import {
|
||||||
SubCard,
|
SubCard,
|
||||||
Separation,
|
Separation,
|
||||||
Sub4Title,
|
Sub4Title,
|
||||||
ColorButton,
|
|
||||||
SingleLine,
|
SingleLine,
|
||||||
|
RightAlign,
|
||||||
} from '../../../components/generic/Styled';
|
} from '../../../components/generic/Styled';
|
||||||
import { useSettings } from '../../../context/SettingsContext';
|
import { useSettings } from '../../../context/SettingsContext';
|
||||||
import {
|
import {
|
||||||
|
@ -32,10 +32,7 @@ import { CloseChannel } from '../../../components/closeChannel/CloseChannel';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { AdminSwitch } from '../../../components/adminSwitch/AdminSwitch';
|
import { AdminSwitch } from '../../../components/adminSwitch/AdminSwitch';
|
||||||
import { DownArrow, UpArrow, EyeOff } from '../../../components/generic/Icons';
|
import { DownArrow, UpArrow, EyeOff } from '../../../components/generic/Icons';
|
||||||
|
import { ColorButton } from '../../../components/buttons/colorButton/ColorButton';
|
||||||
const CloseButton = styled(ColorButton)`
|
|
||||||
margin-left: auto;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const IconPadding = styled.div`
|
const IconPadding = styled.div`
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
|
@ -160,12 +157,16 @@ export const ChannelCard = ({
|
||||||
)}
|
)}
|
||||||
<AdminSwitch>
|
<AdminSwitch>
|
||||||
<Separation />
|
<Separation />
|
||||||
<CloseButton
|
<RightAlign>
|
||||||
color={'red'}
|
<ColorButton
|
||||||
onClick={() => setModalOpen(true)}
|
withBorder={true}
|
||||||
>
|
// color={'red'}
|
||||||
Close Channel
|
arrow={true}
|
||||||
</CloseButton>
|
onClick={() => setModalOpen(true)}
|
||||||
|
>
|
||||||
|
Close Channel
|
||||||
|
</ColorButton>
|
||||||
|
</RightAlign>
|
||||||
</AdminSwitch>
|
</AdminSwitch>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue