|
1 | 1 | /* eslint-disable no-void */ |
2 | 2 | /* eslint-disable react-hooks/rules-of-hooks */ |
3 | 3 | /* eslint-disable react-hooks/exhaustive-deps */ |
4 | | -import React from 'react'; |
5 | | -import type { ISlide } from 'interfaces/ISlide.interface'; |
6 | | -import type { |
7 | | - ISliderContextProps, |
8 | | - ISliderProviderProps, |
9 | | -} from 'interfaces/ISliderProvider.interface'; |
10 | | -import { createContext, useEffect, useState } from 'react'; |
| 4 | +import React, { createContext, useEffect, useState } from 'react'; |
11 | 5 | import { |
12 | 6 | Animated, |
13 | 7 | BackHandler, |
14 | 8 | Dimensions, |
15 | 9 | PanResponder, |
16 | 10 | type PanResponderInstance, |
17 | 11 | } from 'react-native'; |
18 | | -import type { ISliderIntro } from 'interfaces/ISliderIntro.interface'; |
19 | | -import type { IItem } from 'interfaces/IItem.interface'; |
20 | | -import Item from './Item'; |
21 | | -import StatusBarContainer from './StatusBarContainer'; |
22 | | -import Button from './Button'; |
23 | | - |
24 | | -export const defaultProps: ISliderIntro = { |
25 | | - data: [], |
26 | | - renderItem: (item: IItem) => { |
27 | | - const { |
28 | | - index, |
29 | | - title, |
30 | | - text, |
31 | | - image, |
32 | | - backgroundColor, |
33 | | - activeLanguage, |
34 | | - link, |
35 | | - slideMaxHeightPercent, |
36 | | - } = item; |
37 | | - return ( |
38 | | - <Item |
39 | | - key={index} |
40 | | - index={index} |
41 | | - title={title} |
42 | | - text={text} |
43 | | - image={image} |
44 | | - backgroundColor={backgroundColor} |
45 | | - activeLanguage={activeLanguage} |
46 | | - link={link} |
47 | | - slideMaxHeightPercent={slideMaxHeightPercent} |
48 | | - /> |
49 | | - ); |
50 | | - }, |
51 | | - navigationBarBottom: 0, |
52 | | - navigationBarHeight: 70, |
53 | | - animateSlideSpeed: 15, |
54 | | - navContainerMaxSizePercent: 0.5, |
55 | | - dotWidth: 12, |
56 | | - fixDotOpacity: 0.35, |
57 | | - fixDotBackgroundColor: 'grey', |
58 | | - animatedDotBackgroundColor: 'white', |
59 | | - animateDotSpeed: 8, |
60 | | - animateDotBouncing: 2, |
61 | | - backHandlerBehaviour: 'activeMinusOne', |
62 | | - hasReactNavigation: false, |
63 | | - useCustomBackHandlerEffect: () => {}, |
64 | | - skipLabel: 'Skip', |
65 | | - nextLabel: 'Next', |
66 | | - doneLabel: 'Done', |
67 | | - renderSkipButton: (skipLabel: string | undefined) => ( |
68 | | - <Button label={skipLabel} type="skip" /> |
69 | | - ), |
70 | | - renderNextButton: (nextLabel: string | undefined) => ( |
71 | | - <Button label={nextLabel} type="next" /> |
72 | | - ), |
73 | | - renderDoneButton: (doneLabel: string | undefined) => ( |
74 | | - <Button label={doneLabel} type="done" /> |
75 | | - ), |
76 | | - onDone: () => {}, |
77 | | - onSkip: () => {}, |
78 | | - showLeftButton: true, |
79 | | - leftButtonType: 'skip', |
80 | | - columnButtonStyle: false, |
81 | | - showStatusBar: false, |
82 | | - statusBarColor: '#febe29', |
83 | | - renderStatusBar: (backgroundColor: string) => ( |
84 | | - <StatusBarContainer backgroundColor={backgroundColor} /> |
85 | | - ), |
86 | | -}; |
| 12 | +import defaultProps from '../defaultProps'; |
| 13 | +import type { ISlide } from '../interfaces/ISlide.interface'; |
| 14 | +import type { |
| 15 | + ISliderContextProps, |
| 16 | + ISliderProviderProps, |
| 17 | +} from '../interfaces/ISliderProvider.interface'; |
87 | 18 |
|
88 | 19 | const defaultSlideState: ISlide = { |
89 | 20 | active: 0, |
|
0 commit comments