diff --git a/components/timetable/HourSlice.tsx b/components/timetable/HourSlice.tsx index 3b810d1..f579030 100644 --- a/components/timetable/HourSlice.tsx +++ b/components/timetable/HourSlice.tsx @@ -12,15 +12,16 @@ interface HourSliceProps extends CardProps { animationsDisabled: boolean, smallMode: boolean, onPress: (lecture: Lecture) => void, + expand?: number } function getDelayBasedOnPosition(top: number, left: number) { return (top + left * 2) * 0.3 } -function HourSlice({style, item, onPress, smallMode = false, animationsDisabled = true}: HourSliceProps) { +function HourSlice({style, item, onPress, smallMode = false, animationsDisabled = true, expand = 0}: HourSliceProps) { const {course, eventType, start_time, end_time, color, colorText, rooms, lecturers, executionType, usersNote} = item.lecture - const { colors } = useTheme() + const { colors, theme } = useTheme() const hexColor = (color === null || color === '') ? colors.onBackground : `#${color}` const top = useSharedValue(animationsDisabled ? 0 : 50) @@ -37,10 +38,13 @@ function HourSlice({style, item, onPress, smallMode = false, animationsDisabled }) const textSize = { fontSize: smallMode ? 12 : 14} - // TODO: in week view, make slices wider return ( - - + + {course ? course : eventType} @@ -65,14 +69,15 @@ export default HourSlice const styles = StyleSheet.create({ pressable: { - borderRadius: 10, - overflow: 'hidden', - borderWidth: 1 + }, container: { flex: 1, paddingHorizontal: 5, paddingTop: 5, + borderRadius: 10, + overflow: 'hidden', + borderWidth: 1 }, titleContainer: { flexDirection: 'row', diff --git a/screens/MainScreen/OptionsScreen.tsx b/screens/MainScreen/OptionsScreen.tsx index 245d0b1..9d7306a 100644 --- a/screens/MainScreen/OptionsScreen.tsx +++ b/screens/MainScreen/OptionsScreen.tsx @@ -67,20 +67,18 @@ function OptionsScreen() { const pickerStyle: Partial = { dropdownIconColor: colors.onBackground, dropdownIconRippleColor: colors.touchColor, - itemStyle: { - color: colors.onBackground, - //textAlign: 'right' - }, style: { - flex: 2 - //height: 54, - //textAlign: 'right' + flex: 2, + // Apply the background color to the parent Picker component to fill the "margins" + backgroundColor: colors.background, } } const pickerItmeStyle: Partial = { color: colors.onBackground, - //fontFamily: '' + style: { + backgroundColor: colors.background, + } } return ( @@ -90,11 +88,12 @@ function OptionsScreen() { General Restart setup Change selected groups - Appearance + Appearance - Theme + Theme @@ -102,8 +101,8 @@ function OptionsScreen() { - Default timetable view - + Default timetable view + @@ -143,9 +142,5 @@ const styles = StyleSheet.create({ height: 54 }, pickerContainer: { - flexDirection: 'row', - //alignContent: 'center', - justifyContent: 'space-between', - height: 54 } }) \ No newline at end of file diff --git a/screens/MainScreen/TimeTableScreen.tsx b/screens/MainScreen/TimeTableScreen.tsx index b4050c2..f24b0aa 100644 --- a/screens/MainScreen/TimeTableScreen.tsx +++ b/screens/MainScreen/TimeTableScreen.tsx @@ -186,7 +186,7 @@ function TimeTableScreen({ route }: TimeTableScreenProps) { setShowDatePicker(false) } - const WeekNum = useMemo(() => , [date]) + const WeekNum = useMemo(() => , [date, theme]) return ( {setModalLecture(null)}} /> @@ -201,7 +201,7 @@ function TimeTableScreen({ route }: TimeTableScreenProps) { } + renderItem={({key, ...props}) => } date={(isWeekView ? undefined : date) as any} range={isWeekView ? week : undefined} @@ -277,14 +277,14 @@ function TimeTableScreen({ route }: TimeTableScreenProps) { /> : - setDate(dayjs(date).subtract(1, 'week').toDate())} /> + setDate(dayjs(date).subtract(1, 'week').toDate())} /> Week {WeekNum} - setDate(dayjs(date).add(1, 'week').toDate())}/> + setDate(dayjs(date).add(1, 'week').toDate())}/> }