-
Notifications
You must be signed in to change notification settings - Fork 23
[jules] enhance: Add skeleton loading for mobile home screen #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||
| import React from 'react'; | ||||||
| import { View } from 'react-native'; | ||||||
| import { Card } from 'react-native-paper'; | ||||||
| import Skeleton from '../ui/Skeleton'; | ||||||
|
|
||||||
| const GroupListSkeleton = () => { | ||||||
| // Render 4 skeleton items to fill the screen | ||||||
| return ( | ||||||
| <View style={{ padding: 16 }} accessibilityLabel="Loading groups"> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Without ♿ Proposed fix- <View style={{ padding: 16 }} accessibilityLabel="Loading groups">
+ <View style={{ padding: 16 }} accessible={true} accessibilityLabel="Loading groups">📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| {[1, 2, 3, 4].map((i) => ( | ||||||
| <Card key={i} style={{ marginBottom: 16 }}> | ||||||
| <View style={{ flexDirection: 'row', alignItems: 'center', padding: 16 }}> | ||||||
| <Skeleton width={40} height={40} borderRadius={20} style={{ marginRight: 16 }} /> | ||||||
| <Skeleton width={150} height={20} /> | ||||||
| </View> | ||||||
| <Card.Content> | ||||||
| <Skeleton width={220} height={16} style={{ marginTop: 4 }} /> | ||||||
| </Card.Content> | ||||||
| </Card> | ||||||
| ))} | ||||||
| </View> | ||||||
| ); | ||||||
| }; | ||||||
|
|
||||||
| export default GroupListSkeleton; | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||
| import React, { useEffect, useRef } from 'react'; | ||||||
| import { Animated, View } from 'react-native'; | ||||||
| import { useTheme } from 'react-native-paper'; | ||||||
|
|
||||||
| const Skeleton = ({ width, height, borderRadius, style }) => { | ||||||
| const theme = useTheme(); | ||||||
| const opacity = useRef(new Animated.Value(0.3)).current; | ||||||
|
|
||||||
| useEffect(() => { | ||||||
| const animation = Animated.loop( | ||||||
| Animated.sequence([ | ||||||
| Animated.timing(opacity, { | ||||||
| toValue: 1, | ||||||
| duration: 800, | ||||||
| useNativeDriver: true, | ||||||
| }), | ||||||
| Animated.timing(opacity, { | ||||||
| toValue: 0.3, | ||||||
| duration: 800, | ||||||
| useNativeDriver: true, | ||||||
| }), | ||||||
| ]) | ||||||
| ); | ||||||
| animation.start(); | ||||||
|
|
||||||
| return () => animation.stop(); | ||||||
| }, [opacity]); | ||||||
|
|
||||||
| return ( | ||||||
| <Animated.View | ||||||
| style={[ | ||||||
| { | ||||||
| width, | ||||||
| height, | ||||||
| borderRadius: borderRadius || 4, | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use nullish coalescing
🐛 Proposed fix- borderRadius: borderRadius || 4,
+ borderRadius: borderRadius ?? 4,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| backgroundColor: theme.colors.surfaceVariant, | ||||||
| opacity, | ||||||
| }, | ||||||
| style, | ||||||
| ]} | ||||||
| /> | ||||||
|
Comment on lines
+30
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hide the skeleton placeholder from screen readers. Without ♿ Proposed fix <Animated.View
+ accessible={false}
+ importantForAccessibility="no-hide-descendants"
style={[🤖 Prompt for AI Agents |
||||||
| ); | ||||||
| }; | ||||||
|
|
||||||
| export default Skeleton; | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a blank line before the fenced code block to fix the
MD031lint warning.markdownlintrequires blank lines surrounding fenced code blocks.📝 Proposed fix
**Example:** + ```jsx <Card>📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 314-314: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
🤖 Prompt for AI Agents