Skip to content

Commit

Permalink
⚖️ add custom required mark (cyclops-ui#453)
Browse files Browse the repository at this point in the history
* add custom required mark

* remove unused import
  • Loading branch information
petar-cvit authored Jul 20, 2024
1 parent 02fb7f0 commit 377c44a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cyclops-ui/src/components/pages/EditModule/EditModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,20 @@ const EditModule = () => {
onFinish={handleSubmitTemplateEdit}
onFinishFailed={onFinishFailed}
style={{ width: "100%" }}
requiredMark={(label, { required }) => (
<Row>
<Col>
{required ? (
<span style={{ color: "red", paddingRight: "3px" }}>
*
</span>
) : (
<></>
)}
</Col>
<Col>{label}</Col>
</Row>
)}
>
{lockButton()}
<Form.Item
Expand Down
12 changes: 12 additions & 0 deletions cyclops-ui/src/components/pages/NewModule/NewModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,18 @@ const NewModule = () => {
autoComplete={"off"}
onFinish={handleSubmit}
onFinishFailed={onFinishFailed}
requiredMark={(label, { required }) => (
<Row>
<Col>
{required ? (
<span style={{ color: "red", paddingRight: "3px" }}>*</span>
) : (
<></>
)}
</Col>
<Col>{label}</Col>
</Row>
)}
>
<Divider orientation="left" orientationMargin="0">
Module template
Expand Down

0 comments on commit 377c44a

Please sign in to comment.