Skip to content

Commit

Permalink
Fix css
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 committed Sep 8, 2023
1 parent 07cdf8e commit abd3144
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.continue-button {
background-color: var(--pf-v5-global--success-color--100) !important;
margin-right: 10px;
}

.retake-button {
background-color: var(--pf-v5-global--warning-color--100) !important ;
margin-right: 10px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ import {
InitialAssessment,
Questionnaire,
} from "@app/api/models";
import {
useCreateAssessmentMutation,
useFetchAssessmentsByAppId,
} from "@app/queries/assessments";
import { useCreateAssessmentMutation } from "@app/queries/assessments";
import { Button } from "@patternfly/react-core";
import React, { FunctionComponent } from "react";
import { useHistory } from "react-router-dom";
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";
import "./dynamic-assessment-button.css";

enum AssessmentAction {
Take = "Take",
Expand Down Expand Up @@ -52,14 +49,12 @@ const DynamicAssessmentButton: FunctionComponent<
}
};

const determineButtonBackgroundColor = () => {
const determineButtonClassName = () => {
const action = determineAction();
if (action === AssessmentAction.Continue) {
return "#5ba353"; // Continue background color
return "continue-button";
} else if (action === AssessmentAction.Retake) {
return "#F0AB01"; // Retake background color
} else {
return ""; // Default background color for "Take"
return "retake-button";
}
};

Expand Down Expand Up @@ -100,12 +95,9 @@ const DynamicAssessmentButton: FunctionComponent<
return (
<div>
<Button
className={spacing.mrSm}
type="button"
variant="primary"
style={{
backgroundColor: determineButtonBackgroundColor(),
}}
className={determineButtonClassName()}
onClick={() => {
onHandleAssessmentAction();
}}
Expand Down

0 comments on commit abd3144

Please sign in to comment.