feat: 添加测试框架和优化项目结构
- 添加 Jest 配置和测试设置 - 添加 use-categories hook 的单元测试 - 更新 CLAUDE.md 添加包管理工具说明 - 优化首页、视频页和频道页的组件结构 - 添加 .claude 命令配置文件 - 移除 bun.lock 和 package-lock.json,统一使用 bun - 更新 package.json 依赖 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,8 @@ const { width: screenWidth } = Dimensions.get('window')
|
||||
|
||||
const horizontalPadding = 8 * 2
|
||||
const cardGap = 5
|
||||
const cardWidth = (screenWidth - horizontalPadding - cardGap) / 2
|
||||
const numColumns = 3
|
||||
const cardWidth = (screenWidth - horizontalPadding - cardGap * (numColumns - 1)) / numColumns
|
||||
|
||||
export function HomeSkeleton() {
|
||||
return (
|
||||
@@ -25,12 +26,11 @@ export function HomeSkeleton() {
|
||||
|
||||
{/* 卡片骨架屏 */}
|
||||
<View style={styles.gridContainer}>
|
||||
{[1, 2, 3, 4, 5, 6].map((_, index) => (
|
||||
{[1, 2, 3, 4, 5, 6, 7, 8, 9].map((_, index) => (
|
||||
<View
|
||||
key={index}
|
||||
style={[
|
||||
styles.cardSkeleton,
|
||||
index % 2 === 0 ? styles.cardLeft : styles.cardRight,
|
||||
{ width: cardWidth },
|
||||
]}
|
||||
>
|
||||
@@ -64,15 +64,9 @@ const styles = StyleSheet.create({
|
||||
flexDirection: 'row',
|
||||
flexWrap: 'wrap',
|
||||
paddingHorizontal: 8,
|
||||
justifyContent: 'space-between',
|
||||
gap: 5,
|
||||
},
|
||||
cardSkeleton: {
|
||||
marginBottom: 12,
|
||||
},
|
||||
cardLeft: {
|
||||
marginRight: 0,
|
||||
},
|
||||
cardRight: {
|
||||
marginLeft: 0,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user