mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
Implement new form features
Extends existing functionality, provides new fallbacks for translations and adds capabilities to manage array properties in configurations. Committed-by: Florian Scholdei <florian.scholdei@cloudogu.com> Co-authored-by: Florian Scholdei <florian.scholdei@cloudogu.com>
This commit is contained in:
committed by
SCM-Manager
parent
719f6c4c09
commit
dda52b8400
@@ -24,13 +24,26 @@
|
||||
|
||||
import React, { HTMLProps } from "react";
|
||||
import classNames from "classnames";
|
||||
import styled from "styled-components";
|
||||
|
||||
const FormRowDiv = styled.div`
|
||||
.field {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
gap: 1rem;
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
`;
|
||||
|
||||
const FormRow = React.forwardRef<HTMLDivElement, HTMLProps<HTMLDivElement>>(
|
||||
({ className, children, hidden, ...rest }, ref) =>
|
||||
hidden ? null : (
|
||||
<div ref={ref} className={classNames("columns", className)} {...rest}>
|
||||
<FormRowDiv ref={ref} className={classNames("is-flex is-flex-wrap-wrap", className)} {...rest}>
|
||||
{children}
|
||||
</div>
|
||||
</FormRowDiv>
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user