Skip to content

Commit a25ad45

Browse files
committed
fix elements align and add close button
Signed-off-by: Ricardo M G da Silva <[email protected]>
1 parent 1eaa20e commit a25ad45

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

src/components/Dialogs/ContributeToCatalog.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,8 @@ const ContributeToCatalog = forwardRef((props, ref) => {
607607
hasSubmit={true}
608608
leftButton={workflowState > 1 ? "Previous" : "Close"}
609609
rightButton={workflowState < 3 ? "Next" : "Close"}
610+
auxiliaryButton={workflowState === 2}
611+
onHandleEventAuxiliaryButton={close}
610612
title={"Contribute your TM to a TM Catalog"}
611613
description={
612614
"Fullfil the form below to contribute your TM to the Catalog specified in the endpoint at the end."

src/components/Dialogs/DialogTemplate.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ interface DialogTemplateProps {
2323
onHandleEventRightButton?: () => void;
2424
hasSubmit?: boolean;
2525
className?: string;
26+
auxiliaryButton?: boolean;
27+
onHandleEventAuxiliaryButton?: () => void;
2628
}
2729

2830
const DialogTemplate: React.FC<DialogTemplateProps> = (props) => {
@@ -36,6 +38,9 @@ const DialogTemplate: React.FC<DialogTemplateProps> = (props) => {
3638

3739
const rightText = props.rightButton ?? "Submit";
3840
const onHandleEventRightButton = props.onHandleEventRightButton ?? (() => {});
41+
const auxiliaryButton = props.auxiliaryButton ?? false;
42+
const onHandleEventAuxiliaryButton =
43+
props.onHandleEventAuxiliaryButton ?? (() => {});
3944
const hasSubmit = props.hasSubmit ?? true;
4045
const className = props.className ?? "lg:w-[40%]";
4146

@@ -72,18 +77,30 @@ const DialogTemplate: React.FC<DialogTemplateProps> = (props) => {
7277
onClick={() => onHandleEventLeftButton()}
7378
variant="primary"
7479
type="button"
75-
className="mr-1"
80+
className="ml-2"
7681
>
7782
{leftText}
7883
</BaseButton>
7984
)}
85+
{auxiliaryButton && (
86+
<BaseButton
87+
id="closeButton"
88+
onClick={() => onHandleEventAuxiliaryButton()}
89+
variant="primary"
90+
type="button"
91+
className="ml-2 flex"
92+
>
93+
Close
94+
</BaseButton>
95+
)}
96+
8097
{hasSubmit && (
8198
<BaseButton
8299
id="rightButton"
83100
onClick={() => onHandleEventRightButton()}
84101
variant="primary"
85102
type="button"
86-
className="flex"
103+
className="ml-2 flex"
87104
>
88105
{rightText}
89106
</BaseButton>

src/components/Dialogs/base/FormCatalogFields.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const FormCatalogFields: React.FC<IFormCatalogFieldsProps> = ({
6464
Add fields for Cataloging to ensure quality and discoverability of
6565
Thing Models
6666
</h1>
67-
<div className="w-[70%] flex-row px-4">
67+
<div className="mx-auto w-[70%] flex-col px-4">
6868
<DialogTextField
6969
label="Model*"
7070
placeholder="The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers."

src/components/Dialogs/base/FormCatalogTmEndpoints.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const FormCatalogTmEndpoints: React.FC<IFormCatalogTMEndpoints> = ({
5858
<h1 className="font-bold">
5959
Add the TM Catalog Endpoint and Repository URL
6060
</h1>
61-
<div className="w-[70%] px-4">
61+
<div className="mx-auto w-[70%] flex-col px-4">
6262
<DialogTextField
6363
label="TM Catalog Endpoint"
6464
placeholder="TM Catalog Endpoint:..."

0 commit comments

Comments
 (0)