Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

248 add character limit on project names #251

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions src/components/create/form/DevpostInfoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ const DevpostInfoForm: React.FC<Props> = props => {
<Col {...FORM_LAYOUT.full}>
<Form.Item
name="name"
rules={[FORM_RULES.requiredRule]}
rules={[FORM_RULES.requiredRule, FORM_RULES.maxLengthRule]}
label="Project Name (should match Devpost submission name)"
>
<Input placeholder="Alexa Assistant" />
<Input placeholder="Alexa Assistant" maxLength={30} />
hgutha marked this conversation as resolved.
Show resolved Hide resolved
</Form.Item>
</Col>
</Row>
Expand Down
6 changes: 4 additions & 2 deletions src/components/epicenter/JudgingBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ const JudgingBox: React.FC<Props> = props => {
<AccordionButton _expanded={{ bg: 'purple.400', color: 'white' }}>
<Box as="span" flex='1' textAlign='left'>
<Flex alignItems='center' justify='space-between'>
<Text><Badge>{props.project.id}</Badge> {props.project.name} </Text>

<Text>
<Badge>{props.project.id}</Badge>
<Text mx={1.5} as="span">{props.project.name}</Text>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change to ml instead of mx? Once we have char limit, we won't need right margin

</Text>
<Flex gap={4}>
<Badge colorScheme={colorSchemeMapper[props.project.round]}>R: {props.project.round}</Badge>

Expand Down
4 changes: 4 additions & 0 deletions src/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export const FORM_RULES = {
type: "email",
message: "Please enter a valid email.",
} as Rule,
maxLengthRule: {
max: 30,
message: 'Project name cannot exceed 50 characters'
hgutha marked this conversation as resolved.
Show resolved Hide resolved
} as Rule,
};

export const FORM_LAYOUT = {
Expand Down