Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,13 @@
align-self: flex-start;
}

/* Leave Team Form */
.leave-team-form__body {
display: flex;
flex-direction: column;
gap: var(--gap-2xl);
align-items: flex-start;
align-self: stretch;
}

.leave-team-form__text {
color: var(--modal-text-color--default);
font-weight: var(--font-weight-regular);
font-size: var(--font-size-body-lg);
font-style: normal;
line-height: var(--line-height-md);
.team-settings__text--bold {
font-weight: var(--font-weight-bold);
}

/* Disband team Form */
.disband-team-form__body {
.disband-team-form__form {
display: flex;
flex-direction: column;
gap: var(--gap-2xl);
align-items: flex-start;
align-self: stretch;
}

.disband-team-form__text {
color: var(--modal-text-color--default);
font-weight: var(--font-weight-regular);
font-size: var(--font-size-Body-lg);
font-style: normal;
line-height: var(--line-height-md);
}

.disband-team-form__text--bold {
color: var(--color-text-primary);

font-weight: var(--font-weight-bold);
line-height: var(--line-height-bold);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
Modal,
NewButton,
NewIcon,
NewLink,
NewTextInput,
useToast,
} from "@thunderstore/cyberstorm";
Expand Down Expand Up @@ -179,14 +178,7 @@ function LeaveTeamForm(props: {
<Modal.Body>
<span>
You are about to leave the team{" "}
<NewLink
primitiveType="cyberstormLink"
linkId="Team"
team={teamName}
csVariant="cyber"
>
{teamName}.
</NewLink>
<span className="team-settings__text--bold">{teamName}</span>.
</span>
</Modal.Body>
<Modal.Footer>
Expand Down Expand Up @@ -237,6 +229,8 @@ function DisbandTeamForm(props: {
team_name: "",
});

const formDisabled = formInputs.team_name !== teamName;

type SubmitorOutput = Awaited<ReturnType<typeof teamDisband>>;

async function submitor(data: typeof formInputs): Promise<SubmitorOutput> {
Expand Down Expand Up @@ -301,29 +295,37 @@ function DisbandTeamForm(props: {
<Modal.Body>
<div>
You are about to disband the team{" "}
<NewLink
primitiveType="cyberstormLink"
linkId="Team"
team={teamName}
csVariant="cyber"
>
{teamName}.
</NewLink>
<span className="team-settings__text--bold">{teamName}</span>.
</div>
<div>
As a precaution, to disband your team, please input{" "}
<span className="disband-team-form__text--bold">{teamName}</span> into
the field below.
<span className="team-settings__text--bold">{teamName}</span> into the
field below.
</div>
<NewTextInput
onChange={(e) =>
updateFormFieldState({ field: "team_name", value: e.target.value })
}
/>

<form
onSubmit={(event) => {
event.preventDefault();
if (!formDisabled) {
strongForm.submit();
}
}}
className="disband-team-form__form"
>
<NewTextInput
onChange={(e) =>
updateFormFieldState({
field: "team_name",
value: e.target.value,
})
}
/>
</form>
</Modal.Body>
<Modal.Footer>
<NewButton
csVariant="danger"
disabled={formDisabled}
onClick={() => {
strongForm.submit();
}}
Expand All @@ -338,4 +340,4 @@ function DisbandTeamForm(props: {
);
}

LeaveTeamForm.displayName = "LeaveTeamForm";
DisbandTeamForm.displayName = "DisbandTeamForm";
Loading