@@ -4,23 +4,21 @@ import {NAVIGATION} from '../../../../Constants';
4
4
import { Text } from 'react-native-gesture-handler' ;
5
5
6
6
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
+ }
8
10
9
11
const handlePageChange = link => {
10
12
// Extract the base URL correctly - keep everything before the last path segment
11
13
const urlParts = pageLink . split ( '/' ) ;
12
14
const baseUrl = urlParts . slice ( 0 , - 1 ) . join ( '/' ) ;
13
-
15
+
14
16
// Construct the full URL by combining the base URL with the pagination link
15
17
// 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
+
22
20
// Navigate to the same screen with the updated URL
23
- navigation . push ( NAVIGATION . comicDetails , {
21
+ navigation . replace ( NAVIGATION . comicDetails , {
24
22
...route ?. params ,
25
23
link : fullUrl ,
26
24
} ) ;
@@ -47,8 +45,9 @@ const styles = StyleSheet.create({
47
45
flexDirection : 'row' ,
48
46
justifyContent : 'center' ,
49
47
alignItems : 'center' ,
50
- paddingVertical : 20 ,
48
+ marginVertical : 20 ,
51
49
flexWrap : 'wrap' ,
50
+ marginBottom : 40 ,
52
51
} ,
53
52
pageButton : {
54
53
paddingHorizontal : 12 ,
0 commit comments