add input component for meal item
This commit is contained in:
		
							parent
							
								
									c4192ced47
								
							
						
					
					
						commit
						b2fcdfe8cd
					
				
							
								
								
									
										12
									
								
								src/components/UI/Input.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								src/components/UI/Input.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					import classes from "./Input.module.css";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const Input = (props) => {
 | 
				
			||||||
 | 
					  return (
 | 
				
			||||||
 | 
					    <div className={classes.input}>
 | 
				
			||||||
 | 
					      <label htmlFor={props.input.id}>{props.label}</label>
 | 
				
			||||||
 | 
					      <input id={props.input.id} {...props.input} />
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default Input;
 | 
				
			||||||
							
								
								
									
										18
									
								
								src/components/UI/Input.module.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/components/UI/Input.module.css
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					.input {
 | 
				
			||||||
 | 
					  display: flex;
 | 
				
			||||||
 | 
					  align-items: center;
 | 
				
			||||||
 | 
					  margin-bottom: 0.5rem;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.input label {
 | 
				
			||||||
 | 
					  font-weight: bold;
 | 
				
			||||||
 | 
					  margin-right: 1rem;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.input input {
 | 
				
			||||||
 | 
					  width: 3rem;
 | 
				
			||||||
 | 
					  border-radius: 5px;
 | 
				
			||||||
 | 
					  border: 1px solid #ccc;
 | 
				
			||||||
 | 
					  font: inherit;
 | 
				
			||||||
 | 
					  padding-left: 0.5rem;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user