-
Notifications
You must be signed in to change notification settings - Fork 9
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
Fixes #210
base: dev
Are you sure you want to change the base?
Fixes #210
Conversation
amitojsingh
commented
Oct 16, 2024
•
edited
Loading
edited
- Added Crashlytics
- Updated code to fetch data of Home Screen if there is Blank screen.
- updated Pods
- Fix Auto Scroll
- Improved Reader and home Screen
- Improved Database connect call
- Improve Error Handling
- Fix Deep Scan errors
- Fix Null checks.
- remove unnecessary parameters
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.
Added comments in code, mostly minor changes. Have a look.
Also, can you please update the PR title to something more relevant about the changes being done here.
defaultBaniOrder && | ||
Array.isArray(defaultBaniOrder.baniOrder) && | ||
defaultBaniOrder.baniOrder.length > 0 | ||
) { |
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.
We can make this if statement more readable using optional chaining
if (defaultBaniOrder?.baniOrder?.length) {
...
color={colors.WHITE_COLOR} | ||
/> | ||
); | ||
}; |
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.
Minor thing, since it only returns a JSx element, we can write it directly as
const headerLeft = () => (
<Icon
name="arrow-back"
size={30}
onPress={handleBackPress}
color={colors.WHITE_COLOR}
/>
);
}; | ||
</View> | ||
); | ||
}; |
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.
Similar to headerLeft
, this can be optimized as well without using return keyword.
const headerRight = () => (
<View style={{ flexDirection: "row" }}>
<Icon
name="bookmark"
color={colors.TOOLBAR_TINT}
size={30}
onPress={handleBookmarkPress}
/>
<Icon
name="settings"
color={colors.TOOLBAR_TINT}
size={30}
onPress={handleSettingsPress}
/>
</View>
);
Animated.timing(animationPosition, { | ||
toValue: value, | ||
duration: 500, | ||
// easing: Easing.ease, |
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.
We can remove this comment if not needed anymore.
let scrollY = (document.body.scrollHeight - window.innerHeight) * ${position}; | ||
window.scrollTo(0, scrollY); | ||
let curPosition = scrollY; | ||
function clearScrollTimeout() { |
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.
Can be converted to ES6 arrow function syntax.
autoScrollTimeout = null; | ||
} | ||
|
||
function scrollFunc(e) { |
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.
Same as above, can be converted to arrow syntax of function
function setAutoScroll() { | ||
let speed = autoScrollSpeed; | ||
const speed = autoScrollSpeed; |
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.
Can be converted to arrow syntax.
|
||
window.addEventListener( | ||
"orientationchange", | ||
function () { |
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.
Can be converted to arrow syntax.
let englishTranslation; | ||
let punjabiTranslation; | ||
let spanishTranslation; | ||
let paragraphID = null; |
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.
Can be changed to camelcase for consistent naming practice paragraphId