Skip to content

Commit f4678c4

Browse files
committed
fix(courseTable): restore schedule spacing
1 parent 74a97a2 commit f4678c4

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

src/modules/courseTable/components/WeekSelector.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ const WeekSelector: FC<WeekSelectorProps> = ({
296296
commonStyles.fontSemiBold,
297297
{
298298
position: 'absolute',
299-
bottom: -12,
299+
bottom: -14,
300300
width: 31,
301301
overflow: 'visible',
302302
color: '#7878F8',
@@ -326,7 +326,7 @@ const styles = StyleSheet.create({
326326
pickerContainer: {
327327
position: 'absolute',
328328
width: '100%',
329-
borderEndStartRadius: 8,
329+
borderStartEndRadius: 8,
330330
borderEndEndRadius: 8,
331331
padding: 10,
332332
shadowColor: '#000',
@@ -367,6 +367,7 @@ const styles = StyleSheet.create({
367367
flexWrap: 'wrap',
368368
gap: 16,
369369
left: 16,
370+
paddingBottom: 10,
370371
alignItems: 'center',
371372
justifyContent: 'flex-start',
372373
},

src/modules/courseTable/components/courseTable/TimetableScrollView.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import Animated, {
1818

1919
import Divider from '@/components/divider';
2020
import Toast from '@/components/toast';
21+
import { COURSE_HEADER_HEIGHT, TIME_WIDTH } from '@/constants/SCHEDULE';
2122

2223
import { commonColors } from '@/styles/common';
2324
import globalEventBus from '@/utils/eventBus';
@@ -63,9 +64,6 @@ const TimetableScrollView = (
6364
const prevTranslateX = useSharedValue(0);
6465
const startX = useSharedValue(0);
6566
const startY = useSharedValue(0);
66-
// FIX_ME 此处为两个 sticky 交界处,会覆盖,很丑,目前方式为计算重叠块大小,用一个块覆盖
67-
const cornerWidth = useSharedValue(0);
68-
const cornerHeight = useSharedValue(0);
6967
// 下拉刷新背景高度
7068
const backHeight = useSharedValue(0);
7169
const isAtTop = useSharedValue(false);
@@ -330,22 +328,22 @@ const TimetableScrollView = (
330328
// Animated style for content margins
331329
const contentMarginStyle = useAnimatedStyle(() => {
332330
return {
333-
marginLeft: cornerWidth.value,
331+
marginLeft: TIME_WIDTH,
334332
};
335333
}, []);
336334

337335
// Animated style for corner dimensions
338336
const defaultCornerStyle = useAnimatedStyle(() => {
339337
return {
340-
height: cornerHeight.value,
341-
width: cornerWidth.value,
338+
height: COURSE_HEADER_HEIGHT,
339+
width: TIME_WIDTH,
342340
};
343341
}, []);
344342

345343
// Animated style for sticky top margin
346344
const stickyTopMarginStyle = useAnimatedStyle(() => {
347345
return {
348-
marginLeft: cornerWidth.value,
346+
marginLeft: TIME_WIDTH,
349347
};
350348
}, []);
351349
// For the sticky top, we only want horizontal scrolling, not vertical
@@ -419,9 +417,6 @@ const TimetableScrollView = (
419417
stickyTopMarginStyle,
420418
animatedOnlyX,
421419
]}
422-
onLayout={layout => {
423-
cornerHeight.value = layout.nativeEvent.layout.height;
424-
}}
425420
>
426421
{stickyTop}
427422
</Animated.View>
@@ -446,9 +441,6 @@ const TimetableScrollView = (
446441
>
447442
{/* stickyLeft */}
448443
<Animated.View
449-
onLayout={layout => {
450-
cornerWidth.value = layout.nativeEvent.layout.width;
451-
}}
452444
style={[
453445
styles.stickyLeft,
454446
{ height: containerSize.height },

0 commit comments

Comments
 (0)