Skip to content

Commit 3673524

Browse files
committed
refactor the code
1 parent 53a35a8 commit 3673524

File tree

1 file changed

+21
-25
lines changed

1 file changed

+21
-25
lines changed

app/components/CodeEditor/CodeEditor.tsx

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -128,32 +128,28 @@ const EditorControls = ({
128128
Reset
129129
</MyBtn>
130130
</Flex>
131-
{
132-
nextStepPath?(
133-
<>
131+
{nextStepPath ? (
132+
<>
134133
<MyBtn
135-
onClick={() => {
136-
if (nextStepPath) router.push("/" + nextStepPath);
137-
}}
138-
variant={
139-
outputResult.validityStatus === "valid" ? "default" : "success"
140-
}
141-
isDisabled={!nextStepPath}
142-
size={outputResult.validityStatus === "valid" ? "sm" : "xs"}
143-
>
144-
Next <span style={{ marginLeft: "4px" }}></span>
145-
<FiChevronRight
146-
color={
147-
outputResult.validityStatus === "valid"
148-
? "white"
149-
: "hsl(var(--success))"
150-
}
151-
/>
152-
</MyBtn>
153-
</>
154-
):
155-
<CertificateButton/>
156-
}
134+
onClick={() => router.push("/" + nextStepPath)}
135+
variant={
136+
outputResult.validityStatus === "valid" ? "default" : "success"
137+
}
138+
size={outputResult.validityStatus === "valid" ? "sm" : "xs"}
139+
>
140+
Next <span style={{ marginLeft: "4px" }}></span>
141+
<FiChevronRight
142+
color={
143+
outputResult.validityStatus === "valid"
144+
? "white"
145+
: "hsl(var(--success))"
146+
}
147+
/>
148+
</MyBtn>
149+
</>
150+
) : (
151+
<CertificateButton />
152+
)}
157153
</div>
158154
);
159155
};

0 commit comments

Comments
 (0)