Skip to content

Commit 966054c

Browse files
fix: handle empty pagination in FooterPagination and adjust navigation method
1 parent ec2948b commit 966054c

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/Screens/Comic/Details/Components/FooterPagination.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,21 @@ import {NAVIGATION} from '../../../../Constants';
44
import {Text} from 'react-native-gesture-handler';
55

66
const PaginationFooter = ({pagination, pageLink, route, navigation}) => {
7-
if (!pagination || pagination.length === 0) return null;
7+
if (!pagination || pagination.length === 0) {
8+
return <View style={styles.paginationContainer} />;
9+
}
810

911
const handlePageChange = link => {
1012
// Extract the base URL correctly - keep everything before the last path segment
1113
const urlParts = pageLink.split('/');
1214
const baseUrl = urlParts.slice(0, -1).join('/');
13-
15+
1416
// Construct the full URL by combining the base URL with the pagination link
1517
// If link already has domain, use it as is
16-
const fullUrl = link.startsWith('http')
17-
? link
18-
: `${baseUrl}/${link}`;
19-
20-
console.log('Full URL:', fullUrl);
21-
18+
const fullUrl = link.startsWith('http') ? link : `${baseUrl}/${link}`;
19+
2220
// Navigate to the same screen with the updated URL
23-
navigation.push(NAVIGATION.comicDetails, {
21+
navigation.replace(NAVIGATION.comicDetails, {
2422
...route?.params,
2523
link: fullUrl,
2624
});
@@ -47,8 +45,9 @@ const styles = StyleSheet.create({
4745
flexDirection: 'row',
4846
justifyContent: 'center',
4947
alignItems: 'center',
50-
paddingVertical: 20,
48+
marginVertical: 20,
5149
flexWrap: 'wrap',
50+
marginBottom: 40,
5251
},
5352
pageButton: {
5453
paddingHorizontal: 12,

src/Screens/Comic/Details/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function ComicDetails({route, navigation}) {
1818
const [PageLink, setPageLink] = useState(route?.params?.link);
1919
const [tabBar, setTabBar] = useState([
2020
{name: 'Chapters', active: true},
21-
{name: 'Bookmarks', active: false},
21+
// {name: 'Bookmarks', active: false},
2222
]);
2323
const {value: forIosValue, loading: forIosLoading} = useFeatureFlag(
2424
'forIos',

0 commit comments

Comments
 (0)