X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Frounds%2FEditForm.js;h=ac2cd427628217a14f29478570c9d8dd1793c952;hb=7ec9287d3114e88c92cd2b480d89a408045cb79c;hp=6472c842a27a28298a13298f2bb5ece02b7bf44a;hpb=c5b15dc5518c627daa4f02f653ff900e4fe13db7;p=alttp.git
diff --git a/resources/js/components/rounds/EditForm.js b/resources/js/components/rounds/EditForm.js
index 6472c84..ac2cd42 100644
--- a/resources/js/components/rounds/EditForm.js
+++ b/resources/js/components/rounds/EditForm.js
@@ -59,6 +59,24 @@ const EditForm = ({
: null}
+
+
+ {i18n.t('rounds.spoiler')}
+
+ {touched.spoiler && errors.spoiler ?
+
+ {i18n.t(errors.spoiler)}
+
+ : null}
+
+
{i18n.t('rounds.code')}
@@ -114,6 +132,7 @@ EditForm.propTypes = {
code: PropTypes.arrayOf(PropTypes.string),
rolled_by: PropTypes.string,
seed: PropTypes.string,
+ spoiler: PropTypes.string,
title: PropTypes.string,
}),
handleBlur: PropTypes.func,
@@ -124,6 +143,7 @@ EditForm.propTypes = {
code: PropTypes.arrayOf(PropTypes.bool),
rolled_by: PropTypes.bool,
seed: PropTypes.bool,
+ spoiler: PropTypes.bool,
title: PropTypes.bool,
}),
values: PropTypes.shape({
@@ -131,6 +151,7 @@ EditForm.propTypes = {
game: PropTypes.string,
rolled_by: PropTypes.string,
seed: PropTypes.string,
+ spoiler: PropTypes.string,
title: PropTypes.string,
}),
};
@@ -161,12 +182,14 @@ export default withFormik({
rolled_by: round.rolled_by || null,
round_id: round.id,
seed: round.seed || '',
+ spoiler: round.spoiler || '',
title: round.title || '',
}),
validationSchema: yup.object().shape({
code: yup.array().of(yup.string()),
- rolled_by: yup.string(),
+ rolled_by: yup.string().nullable(),
seed: yup.string().url(),
+ spoiler: yup.string().url(),
title: yup.string(),
}),
})(withTranslation()(EditForm));