Skip to content
Merged
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 @@ -203,14 +203,20 @@ export default ({ value, onChange }) => {
)
}

const styling = {
challengeNameMaxLength: 200,
challengeSlugMaxLength: 200,
textAreaMaxLength: styling.textAreaMaxLength,
}

const renderForm = () => (
<>
<Grid item xs={12}>
<TextInput
label="Challenge name"
value={name}
onChange={handleNameChange}
maxLength={50}
maxLength={styling.challengeNameMaxLength}
/>
<Typography variant="caption">
The unique publicly visible name of the challenge.
Expand All @@ -221,7 +227,7 @@ export default ({ value, onChange }) => {
label="Unique slug"
value={slug}
onChange={setSlug}
maxLength={50}
maxLength={styling.challengeSlugMaxLength}
/>
<Typography variant="caption">
A unique slug for the challenge. This will be used in e.g.
Expand Down Expand Up @@ -280,7 +286,7 @@ export default ({ value, onChange }) => {
value={description}
onChange={setDescription}
placeholder="Description goes here"
maxLength={1000}
maxLength={styling.textAreaMaxLength}
/>
<Typography variant="caption">
Challenge description.
Expand All @@ -293,7 +299,7 @@ export default ({ value, onChange }) => {
value={insights}
onChange={setInsights}
placeholder="Insights go here"
maxLength={1000}
maxLength={styling.textAreaMaxLength}
/>
<Typography variant="caption">Challenge insights.</Typography>
</Grid>
Expand All @@ -304,7 +310,7 @@ export default ({ value, onChange }) => {
value={resources}
onChange={setResources}
placeholder="Resource go here"
maxLength={1000}
maxLength={styling.textAreaMaxLength}
/>
<Typography variant="caption">Challenge resources.</Typography>
</Grid>
Expand All @@ -315,7 +321,7 @@ export default ({ value, onChange }) => {
value={prizes}
onChange={setPrizes}
placeholder="Prizes go here"
maxLength={1000}
maxLength={styling.textAreaMaxLength}
/>
<Typography variant="caption">Challenge Prizes.</Typography>
</Grid>
Expand All @@ -326,7 +332,7 @@ export default ({ value, onChange }) => {
value={criteria}
onChange={setCriteria}
placeholder="Criteria go here"
maxLength={1000}
maxLength={styling.textAreaMaxLength}
/>
<Typography variant="caption">Challenge criteria.</Typography>
</Grid>
Expand All @@ -337,7 +343,7 @@ export default ({ value, onChange }) => {
value={companyInfo}
onChange={setCompanyInfo}
placeholder="Company info goes here"
maxLength={1000}
maxLength={styling.textAreaMaxLength}
/>
<Typography variant="caption">Company Info</Typography>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion shared/schemas/Challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const ChallengeSchema = new mongoose.Schema({
name: {
type: String,
required: true,
length: 50,
length: 200,
},
partner: {
type: String,
Expand Down