2
0

SelectRow.tsx 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import React, { Component } from 'react';
  2. import styled from 'styled-components';
  3. import Selector from '../Selector';
  4. type PropsType = {
  5. label: string,
  6. value: string,
  7. setActiveValue: (x: string) => void,
  8. options: { value: string, label: string }[],
  9. dropdownLabel?: string
  10. };
  11. type StateType = {
  12. };
  13. export default class SelectRow extends Component<PropsType, StateType> {
  14. render() {
  15. return (
  16. <StyledSelectRow>
  17. <Label>{this.props.label}</Label>
  18. <SelectWrapper>
  19. <Selector
  20. activeValue={this.props.value}
  21. setActiveValue={this.props.setActiveValue}
  22. options={this.props.options}
  23. dropdownLabel={this.props.dropdownLabel}
  24. width='270px'
  25. dropdownMaxHeight={'210px'}
  26. />
  27. </SelectWrapper>
  28. </StyledSelectRow>
  29. );
  30. }
  31. }
  32. const SelectWrapper = styled.div`
  33. display: flex;
  34. `;
  35. const Label = styled.div`
  36. color: #ffffff;
  37. margin-bottom: 10px;
  38. `;
  39. const StyledSelectRow = styled.div`
  40. margin-bottom: 15px;
  41. margin-top: 20px;
  42. `;