Changeset 79a0317 for imaps-frontend/src/components/PublishForm
- Timestamp:
- 01/21/25 03:08:24 (3 days ago)
- Branches:
- main
- Parents:
- 0c6b92a
- Location:
- imaps-frontend/src/components/PublishForm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/src/components/PublishForm/PublishForm.jsx
r0c6b92a r79a0317 15 15 ); 16 16 const [errors, setErrors] = useState({}); 17 const [denyReason, setDenyReason] = useState(''); 18 const [isDenying, setIsDenying] = useState(false); 17 19 18 20 const mapTypeOptions = ['Hospital', 'Faculty', 'House', 'Other']; … … 42 44 onSubmit(form); 43 45 } 46 }; 47 48 const handleDeny = () => { 49 if (!denyReason.trim()) { 50 alert('Please provide a reason for denial.'); 51 return; 52 } 53 onDeny(form.id, form.mapName, denyReason); 54 setIsDenying(false); 44 55 }; 45 56 … … 130 141 <button 131 142 className={styles.cancelButton} 132 onClick={onCancel} 143 onClick={() => { 144 setIsDenying(false); 145 onCancel(); 146 }} 133 147 > 134 148 Cancel … … 136 150 <button 137 151 className={styles.approveButton} 138 onClick={() => onApprove(form.id, form.mapName)}152 onClick={() => onApprove(form.id, form.mapName)} 139 153 > 140 154 Approve … … 142 156 <button 143 157 className={styles.denyButton} 144 onClick={() => onDeny(form.id,form.mapName,"Reason")}158 onClick={() => setIsDenying(true)} 145 159 > 146 160 Deny 147 161 </button> 148 162 </div> 163 {isDenying && ( 164 <div className={styles.denyReason}> 165 <textarea className={styles.denyReasonTextArea} 166 placeholder="Enter reason for denial..." 167 value={denyReason} 168 onChange={(e) => setDenyReason(e.target.value)} 169 /> 170 <div className={styles.buttonGroup}> 171 <button 172 className={styles.denySubmitButton} 173 onClick={handleDeny} 174 > 175 Submit 176 </button> 177 </div> 178 </div> 179 )} 149 180 </div> 150 181 )} -
imaps-frontend/src/components/PublishForm/PublishForm.module.css
r0c6b92a r79a0317 10 10 z-index: 999; /* Behind the modal */ 11 11 } 12 13 .denyReason { 14 display: flex; 15 flex-direction: column; 16 margin-top: 10px; 17 border-radius: 20px; 18 } 19 .denyReasonTextArea{ 20 padding-bottom: 4rem; 21 } 22 23 .denySubmitButton { 24 color: white; 25 margin-right: 10px; 26 } 27 12 28 13 29 /* Modal styles */
Note:
See TracChangeset
for help on using the changeset viewer.