Skip to content
Open
Changes from 1 commit
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
43 changes: 24 additions & 19 deletions Frontend/src/Screens/CalendarScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ const ScheduleScreen = () => {

<Modal
visible={isAddAppointmentModalVisible}
transparent={true}
// transparent={true}
animationType="fade"
onRequestClose={hideAddAppointmentModal}>
<View style={styles.overlay}>
Expand Down Expand Up @@ -453,11 +453,13 @@ const ScheduleScreen = () => {
{/* Form Inputs */}
<ScrollView
style={styles.formContainer}
showsVerticalScrollIndicator={false}>
contentContainerStyle={{ flexGrow: 1 }}
keyboardShouldPersistTaps="handled"
showsVerticalScrollIndicator={false}>
{/* Title Input */}
<View style={styles.inputWrapper}>
<TextInput
placeholder="Appointment title"
placeholder="Appointment Title"
placeholderTextColor="#999"
style={styles.input}
value={newAppointment.title}
Expand Down Expand Up @@ -523,7 +525,7 @@ const ScheduleScreen = () => {
}
/>
</View>
</ScrollView>


{/* Action Buttons */}
<View style={styles.buttonContainer}>
Expand All @@ -538,7 +540,7 @@ const ScheduleScreen = () => {
<Text style={styles.cancelButtonText}>Cancel</Text>
</TouchableOpacity>
</View>

</ScrollView>
{/* Decorative Element */}
<View style={styles.decorativeBottom} />
</View>
Expand Down Expand Up @@ -828,20 +830,23 @@ const styles = StyleSheet.create({
justifyContent: 'center',
alignItems: 'center',
padding: 20,

},
modalContent: {
backgroundColor: '#fff',
borderRadius: 24,
padding: 24,
width: '100%',
maxWidth: 400,
maxHeight: '90%',
shadowColor: '#000',
shadowOffset: {width: 0, height: 10},
shadowOpacity: 0.15,
shadowRadius: 20,
elevation: 10,
},
modalContent: {
backgroundColor: '#fff',
borderRadius: 24,
paddingLeft: 24,
paddingRight:24,
width: '100%',
maxWidth: 400,
flex: 1, // ⭐ IMPORTANT
shadowColor: '#000',
shadowOffset: {width: 0, height: 10},
shadowOpacity: 0.15,
shadowRadius: 20,
elevation: 10,
}
,
Comment on lines 844 to 858
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

flex: 1 makes the modal content fill the entire screen; formatting is broken.

  1. flex: 1 causes modalContent to stretch to fill its parent, turning the dialog into a full-height panel. If a centered dialog is intended, use maxHeight (e.g., maxHeight: '90%') instead of flex: 1 so content can grow with the keyboard but still look like a modal.

  2. The // ⭐ IMPORTANT comment doesn't explain why it's important β€” replace with a meaningful comment or remove it.

  3. The closing } and , on separate lines (848–849) is malformed formatting.

Suggested fix (dialog that grows but doesn't fill the screen)
 modalContent: {
   backgroundColor: '#fff',
   borderRadius: 24,
-  paddingLeft: 24,
-  paddingRight:24,
+  paddingHorizontal: 24,
   width: '100%',
   maxWidth: 400,
-  flex: 1,   // ⭐ IMPORTANT
+  maxHeight: '90%',
   shadowColor: '#000',
   shadowOffset: {width: 0, height: 10},
   shadowOpacity: 0.15,
   shadowRadius: 20,
   elevation: 10,
-}
-,
+},
πŸ€– Prompt for AI Agents
In `@Frontend/src/Screens/CalendarScreen.jsx` around lines 835 - 849, The
modalContent style uses flex: 1 which makes the dialog expand to full height and
breaks formatting; replace flex: 1 with a maxHeight (e.g., maxHeight: '90%') so
the dialog can grow with keyboard input but remain centered, remove or replace
the "// ⭐ IMPORTANT" comment with a concise explanation (e.g., "// allow
vertical growth but don't fill screen") and fix the trailing brace/comma
formatting so the object closes on a single line; locate and update the
modalContent style object in CalendarScreen.jsx accordingly.

closeButton: {
position: 'absolute',
top: 16,
Expand Down Expand Up @@ -898,7 +903,7 @@ const styles = StyleSheet.create({
lineHeight: 20,
},
formContainer: {
marginBottom: 20,
marginBottom: 20,paddingBottom:20,
},
inputWrapper: {
marginBottom: 16,
Expand Down