From ae2295608a4cb30cceb37e2e8463d65be2bd97be Mon Sep 17 00:00:00 2001 From: Magnus Jensen Date: Tue, 28 Apr 2026 11:55:31 -0600 Subject: [PATCH] clean up styles and naming (#44309) Follow up from comments on: #44253 ## Summary by CodeRabbit * **Refactor** * Improved component styling architecture to follow modern CSS naming conventions, enhancing code maintainability and consistency across the setup assistant profile card. No changes to user-facing functionality or appearance. --- .../SetupAssistantProfileCard.tsx | 12 ++++++++---- .../SetupAssistantProfileCard/_styles.scss | 10 +++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/components/SetupAssistantProfileCard/SetupAssistantProfileCard.tsx b/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/components/SetupAssistantProfileCard/SetupAssistantProfileCard.tsx index 6b611c4fd9..ca359c1635 100644 --- a/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/components/SetupAssistantProfileCard/SetupAssistantProfileCard.tsx +++ b/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/components/SetupAssistantProfileCard/SetupAssistantProfileCard.tsx @@ -1,5 +1,6 @@ import React from "react"; import FileSaver from "file-saver"; +import classnames from "classnames"; import { uploadedFromNow } from "utilities/date_format"; @@ -32,9 +33,12 @@ type ISetupAssistantProfileCardProps = | ICustomProfileProps; const SetupAssistantProfileCard = (props: ISetupAssistantProfileCardProps) => { - const baseClass = `setup-assistant-profile-card${ - props.defaultProfile ? "-default-profile" : "" - }`; + const baseClass = "setup-assistant-profile-card"; + + const cardClassName = classnames(baseClass, { + [`${baseClass}--default-profile`]: props.defaultProfile, + }); + const onDownload = () => { const date = new Date(); const filename = `${date.toISOString().split("T")[0]}_${ @@ -51,7 +55,7 @@ const SetupAssistantProfileCard = (props: ISetupAssistantProfileCardProps) => { }; return ( - +
{props.defaultProfile ? ( diff --git a/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/components/SetupAssistantProfileCard/_styles.scss b/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/components/SetupAssistantProfileCard/_styles.scss index e43af2cc53..09c6b8bff5 100644 --- a/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/components/SetupAssistantProfileCard/_styles.scss +++ b/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/components/SetupAssistantProfileCard/_styles.scss @@ -1,8 +1,12 @@ -.setup-assistant-profile-card, .setup-assistant-profile-card-default-profile { +.setup-assistant-profile-card { display: flex; gap: $pad-medium; align-items: center; + &--default-profile { + background-color: $ui-off-white; + } + // TODO: create reusable list item component and use instead of all these styles. &__info { display: flex; @@ -30,8 +34,4 @@ &__download-button, &__delete-button { padding: 11px; // TODO: use a padding value from existing variables. talk to design. } -} - -.setup-assistant-profile-card-default-profile { - background-color: $ui-off-white; } \ No newline at end of file