X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Frounds%2FEditForm.js;h=ac2cd427628217a14f29478570c9d8dd1793c952;hb=a18446cc7494f59388c6f07d59138de9373a8ccf;hp=623e1fb4bb4d8c1c6e29739181bf3e44aab83d65;hpb=f9b15fe79f1f4fa54e411b89eb3a5c06bdfb943d;p=alttp.git
diff --git a/resources/js/components/rounds/EditForm.js b/resources/js/components/rounds/EditForm.js
index 623e1fb..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().nullable(),
seed: yup.string().url(),
+ spoiler: yup.string().url(),
title: yup.string(),
}),
})(withTranslation()(EditForm));