chore(send): remove capitalize from addresses

This commit is contained in:
George Lima 2019-02-08 00:05:26 -03:00
parent 9bb5d4ead6
commit c08145067c
2 changed files with 9 additions and 5 deletions

View File

@ -42,7 +42,7 @@ const ValueWrapper = styled.div`
width: 95%; width: 95%;
padding: 13px; padding: 13px;
opacity: ${(props: PropsWithTheme<{ hasValue: boolean }>) => (props.hasValue ? '1' : '0.2')}; opacity: ${(props: PropsWithTheme<{ hasValue: boolean }>) => (props.hasValue ? '1' : '0.2')};
text-transform: capitalize; text-transform: ${(props: PropsWithTheme<{ capitalize: boolean }>) => (props.capitalize ? 'capitalize' : 'none')};
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -88,7 +88,7 @@ const Option = styled.button`
background-color: #5d5d5d; background-color: #5d5d5d;
cursor: pointer; cursor: pointer;
z-index: 99; z-index: 99;
text-transform: capitalize; text-transform: ${(props: PropsWithTheme<{ capitalize: boolean }>) => (props.capitalize ? 'capitalize' : 'none')};
padding: 5px 10px; padding: 5px 10px;
border-bottom: 1px solid #4e4b4b; border-bottom: 1px solid #4e4b4b;
@ -110,6 +110,7 @@ type Props = {
onChange: string => void, onChange: string => void,
placement?: 'top' | 'bottom', placement?: 'top' | 'bottom',
bgColor?: string, bgColor?: string,
capitalize?: boolean,
}; };
type State = { type State = {
@ -125,6 +126,7 @@ export class SelectComponent extends PureComponent<Props, State> {
placeholder: '', placeholder: '',
placement: 'bottom', placement: 'bottom',
bgColor: theme.colors.inputBackground, bgColor: theme.colors.inputBackground,
capitalize: false,
}; };
onSelect = (value: string) => { onSelect = (value: string) => {
@ -162,7 +164,7 @@ export class SelectComponent extends PureComponent<Props, State> {
render() { render() {
const { isOpen } = this.state; const { isOpen } = this.state;
const { const {
value, options, placeholder, placement, bgColor, value, options, placeholder, placement, bgColor, capitalize,
} = this.props; } = this.props;
return ( return (
@ -174,7 +176,7 @@ export class SelectComponent extends PureComponent<Props, State> {
onClick={() => this.setState(() => ({ isOpen: !isOpen }))} onClick={() => this.setState(() => ({ isOpen: !isOpen }))}
bgColor={bgColor} bgColor={bgColor}
> >
<ValueWrapper hasValue={Boolean(value)}> <ValueWrapper hasValue={Boolean(value)} capitalize={capitalize}>
{this.getSelectedLabel(value) || placeholder} {this.getSelectedLabel(value) || placeholder}
</ValueWrapper> </ValueWrapper>
<SelectMenuButtonWrapper> <SelectMenuButtonWrapper>
@ -194,6 +196,7 @@ export class SelectComponent extends PureComponent<Props, State> {
key={label + optionValue} key={label + optionValue}
onClick={() => this.onSelect(optionValue)} onClick={() => this.onSelect(optionValue)}
bgColor={bgColor} bgColor={bgColor}
capitalize={capitalize}
> >
<TextComponent value={label} /> <TextComponent value={label} />
</Option> </Option>

View File

@ -456,12 +456,13 @@ export class SendView extends PureComponent<Props, State> {
return ( return (
<RowComponent id='send-wrapper' justifyContent='space-between'> <RowComponent id='send-wrapper' justifyContent='space-between'>
<FormWrapper> <FormWrapper>
<InputLabelComponent value='From' /> <InputLabelComponent value='From an address' />
<SelectComponent <SelectComponent
onChange={this.handleChange('from')} onChange={this.handleChange('from')}
value={from} value={from}
placeholder='Select a address' placeholder='Select a address'
options={addresses.map(addr => ({ value: addr, label: addr }))} options={addresses.map(addr => ({ value: addr, label: addr }))}
capitalize={false}
/> />
<InputLabelComponent value='Amount' /> <InputLabelComponent value='Amount' />
<AmountWrapper isEmpty={isEmpty}> <AmountWrapper isEmpty={isEmpty}>