Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
raissaji committed Nov 16, 2024
1 parent 17b4ba8 commit f94ae52
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/src/components/LocationModal/LocationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ const LocationModal: React.FC<LocationModalProps> = ({
<Label htmlFor="address">Address</Label>
<Input
{...register('address', {
// error message if there's no input in address
required: 'Please enter an address',
validate: isAddress,
})}
Expand All @@ -147,6 +148,7 @@ const LocationModal: React.FC<LocationModalProps> = ({
aria-required="true"
/>
{errors.address && (
// error message is triggered from enterting something in address
<p className={styles.errorMsg}>{errors.address.message}</p>
)}
</div>
Expand Down Expand Up @@ -175,6 +177,7 @@ const LocationModal: React.FC<LocationModalProps> = ({
required: 'Select a Tag',
})}
id="tag"
// tag's default value is "Select a tag" unless it already has a tag set
defaultValue={existingLocation?.tag || ''}
className={styles.inputContainer}
aria-required="true"
Expand Down

0 comments on commit f94ae52

Please sign in to comment.