Skip to content

Commit

Permalink
refactor(ui): simpler defaults for styles in select (#1339)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucapette authored and tchiotludo committed Apr 4, 2023
1 parent 531d21f commit 7392420
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions client/src/components/Form/Select/Select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,16 @@ import React from 'react';
import PropTypes from 'prop-types';

const Select = ({ name, label, items, error, wrapperClass, selectClass, blankItem, ...rest }) => {
let wrapperClassRender = 'form-group';
let selectClassRender = 'col-xs-10';
if (wrapperClass) {
wrapperClassRender = wrapperClass;
}
if (selectClass) {
selectClassRender = selectClass;
}

return (
<div className={`${wrapperClassRender}`}>
<div className={`${wrapperClass || 'form-group'}`}>
{label !== '' ? (
<label htmlFor={name} className="col-sm-2 col-form-label">
{label}
</label>
) : (
<div />
)}
<div className={`${selectClassRender}`}>
<div className={`${selectClass || 'col-xs-10'}`}>
<select className={'form-control'} id={name} name={name} {...rest}>
{blankItem && (
<option key="" value="">
Expand Down

0 comments on commit 7392420

Please sign in to comment.