mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-27 13:54:32 +00:00
refactor: enhanced Join Private Lobby form (#3284)
## Description: This pull request enhances the `JoinLobbyModal` component by using the `<form>` component and the `@submit` event. It allows the user to use the enter (return) key to submit instead of grabbing its mouse to click on "Join Lobby". It also introduces a new `submit` argument to the `Button` component. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: @nolhan__ PS: The tests from `tests/InputHandler.test.ts` are failing on both `main` and my branch. EDIT: They no longer fail through the workflow so I guess I didn't have the correct environment
This commit is contained in:
@@ -12,6 +12,7 @@ export class OButton extends LitElement {
|
||||
@property({ type: Boolean }) blockDesktop = false;
|
||||
@property({ type: Boolean }) disable = false;
|
||||
@property({ type: Boolean }) fill = false;
|
||||
@property({ type: Boolean }) submit = false;
|
||||
private static readonly BASE_CLASS =
|
||||
"bg-blue-600 hover:bg-blue-700 text-white font-bold uppercase tracking-wider px-4 py-3 rounded-xl transition-all duration-300 transform hover:-translate-y-px outline-none border border-transparent text-center text-base lg:text-lg whitespace-normal break-words leading-tight overflow-hidden relative";
|
||||
|
||||
@@ -38,6 +39,7 @@ export class OButton extends LitElement {
|
||||
<button
|
||||
class=${classMap(this.getButtonClasses())}
|
||||
?disabled=${this.disable}
|
||||
type=${this.submit ? "submit" : "button"}
|
||||
>
|
||||
<span class="block min-w-0">
|
||||
${this.translationKey === ""
|
||||
|
||||
Reference in New Issue
Block a user