This commit is contained in:
+2304
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,17 @@
|
||||
import InputAmount from './components/inputs/InputAmount';
|
||||
import InputPrice from './components/inputs/InputPrice';
|
||||
|
||||
function App(props) {
|
||||
// const { } = props;
|
||||
|
||||
return (
|
||||
<div className="container py-5">
|
||||
<InputAmount />
|
||||
<InputPrice />
|
||||
<br />
|
||||
<InputPrice currency="$" />
|
||||
<br />
|
||||
<InputPrice currency="€" />
|
||||
<br />
|
||||
<InputPrice currency="¥" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
const InputPrice = (props) => {
|
||||
const { currency = '$' } = props;
|
||||
|
||||
const InputGroupText = () => {
|
||||
return <div className="input-group-text">{currency}</div>;
|
||||
};
|
||||
return (
|
||||
<div className="m-input-price input-price">
|
||||
<div className="input-group">
|
||||
{currency === '$' && InputGroupText()}
|
||||
<input type="text" placeholder="0.00" name="price" className="form-control input-price" />
|
||||
{(currency === '€' || currency === '¥') && InputGroupText()}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default InputPrice;
|
||||
Reference in New Issue
Block a user