Skip to content

Commit 7ff2fe8

Browse files
authored
Merge pull request #1042 from Fragger/player-action-reasonfield-helpertext
Update reason field helperText for player actions
2 parents 682beac + e619fd3 commit 7ff2fe8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

rcongui/src/features/player-action/fields/ReasonField.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { MenuItem, Select } from "@mui/material";
33
import { useTemplates } from "@/hooks/useTemplates";
44
import { useState } from "react";
55

6-
export const ReasonField = ({ control, errors, setValue, ...props }) => {
6+
export const ReasonField = ({ control, errors, setValue, helperText="The message displayed to the player.", ...props }) => {
77
const templates = useTemplates("reason");
88
const [selectedTemplate, setSelectedTemplate] = useState("");
99
const error = errors["reason"];
@@ -29,7 +29,7 @@ export const ReasonField = ({ control, errors, setValue, ...props }) => {
2929
control={control}
3030
rules={{ required: "Reason is required" }}
3131
helperText={
32-
hasError ? error.message : "The message displayed to the player."
32+
hasError ? error.message : helperText
3333
}
3434
multiline
3535
minRows={5}

rcongui/src/features/player-action/forms/BlacklistPlayerFields.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const BlacklistPlayerFormFields = ({
8888
Never expires
8989
</Button>
9090
</Box>
91-
<ReasonField control={control} errors={errors} setValue={setValue} />
91+
<ReasonField control={control} errors={errors} setValue={setValue} helperText="The message displayed to the player. Available variables: {player_id}, {player_name}, {banned_at}, {banned_until}, {expires_at}, {duration}, {expires}, {ban_id}, {blacklist_name}"/>
9292
</Stack>
9393
);
9494
};

rcongui/src/features/player-action/forms/WatchFormFields.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { ReasonField } from '../fields/ReasonField'
22

33
export const WatchFormFields = (props) => {
44
return (
5-
<ReasonField {...props} />
5+
<ReasonField helperText="The reason shown in the discord message upon player connection." {...props} />
66
)
77
};

0 commit comments

Comments
 (0)