Skip to content

Commit

Permalink
Use a CSS module for the FirstUserForm component
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Jan 9, 2025
1 parent 496dae3 commit c3cbe8e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
10 changes: 0 additions & 10 deletions web/src/assets/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ button.remove-link:hover {
color: var(--pf-v5-c-button--m-danger--BackgroundColor);
}

.first-username-dropdown {
position: absolute;
width: 100%;
}

.first-username-wrapper {
position: relative;
width: 100%;
}

#productSelectionForm {
input[type="radio"] {
align-self: center;
Expand Down
9 changes: 9 additions & 0 deletions web/src/components/users/FirstUserForm.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.dropdown {
position: absolute;
width: 100%;
}

.wrapper {
position: relative;
width: 100%;
}
9 changes: 3 additions & 6 deletions web/src/components/users/FirstUserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { _ } from "~/i18n";
import { suggestUsernames } from "~/components/users/utils";
import { useFirstUser, useFirstUserMutation } from "~/queries/users";
import { FirstUser } from "~/types/users";
import * as styles from "./FirstUserForm.module.scss";

const UsernameSuggestions = ({
isOpen = false,
Expand All @@ -56,7 +57,7 @@ const UsernameSuggestions = ({
return (
<Menu
aria-label={_("Username suggestion dropdown")}
className="first-username-dropdown"
className={styles.dropdown}
onMouseEnter={() => setInsideDropDown(true)}
onMouseLeave={() => setInsideDropDown(false)}
>
Expand Down Expand Up @@ -233,11 +234,7 @@ export default function FirstUserForm() {
/>
</FormGroup>

<FormGroup
className="first-username-wrapper"
fieldId="userName"
label={_("Username")}
>
<FormGroup className={styles.wrapper} fieldId="userName" label={_("Username")}>
<TextInput
id="userName"
name="userName"
Expand Down

0 comments on commit c3cbe8e

Please sign in to comment.