mirror of
				https://gitlab.nic.cz/turris/reforis/foris-js.git
				synced 2025-11-03 23:00:31 +01:00 
			
		
		
		
	Add className prop to Switch component
This commit is contained in:
		@@ -19,15 +19,16 @@ Switch.propTypes = {
 | 
				
			|||||||
    ]).isRequired,
 | 
					    ]).isRequired,
 | 
				
			||||||
    helpText: PropTypes.string,
 | 
					    helpText: PropTypes.string,
 | 
				
			||||||
    switchHeading: PropTypes.bool,
 | 
					    switchHeading: PropTypes.bool,
 | 
				
			||||||
 | 
					    className: PropTypes.string,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function Switch({ label, helpText, switchHeading, ...props }) {
 | 
					function Switch({ label, helpText, switchHeading, className, ...props }) {
 | 
				
			||||||
    const uid = useUID();
 | 
					    const uid = useUID();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return (
 | 
					    return (
 | 
				
			||||||
        <div
 | 
					        <div
 | 
				
			||||||
            className={`form-check form-switch mb-3 ${
 | 
					            className={`form-check form-switch ${className || "mb-3"} ${
 | 
				
			||||||
                switchHeading ? "d-flex align-items-center" : null
 | 
					                switchHeading ? "d-flex align-items-center" : ""
 | 
				
			||||||
            }`.trim()}
 | 
					            }`.trim()}
 | 
				
			||||||
        >
 | 
					        >
 | 
				
			||||||
            <input
 | 
					            <input
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user