From 044f0ebdef1c2db34670ed01703e5008f521dd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witalo=20Beni=CC=81cio?= Date: Mon, 9 Jul 2018 17:47:56 -0300 Subject: [PATCH 01/10] new(skip): adding prop to change skipText --- .idea/react-native-simple-onboarding.iml | 12 ++++++++++++ components/Paginator.js | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .idea/react-native-simple-onboarding.iml diff --git a/.idea/react-native-simple-onboarding.iml b/.idea/react-native-simple-onboarding.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/react-native-simple-onboarding.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/components/Paginator.js b/components/Paginator.js index f4c2971..3692e09 100644 --- a/components/Paginator.js +++ b/components/Paginator.js @@ -10,7 +10,7 @@ const getDefaultStyle = (isLight) => ({ const SkipButton = ({ isLight, ...props }) => ( - Skip + {this.props.skipText || Skip} ); @@ -26,11 +26,11 @@ const DoneButton = ({ isLight, size, ...props }) => ( ); const BUTTON_SIZE = 40; -const Paginator = ({ isLight, overlay, showSkip, showNext, showDone, pages, currentPage, onEnd, onNext }) => ( +const Paginator = ({ isLight, overlay, showSkip, showNext, showDone, pages, currentPage, onEnd, onNext, skipText }) => ( {showSkip && currentPage + 1 !== pages ? - : + : null } From eb716d7f875dbac3c49c141dfd8f243b46d34839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witalo=20Beni=CC=81cio?= Date: Mon, 9 Jul 2018 17:49:14 -0300 Subject: [PATCH 02/10] new(skip): adding prop to change skipText --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 43cfab4..159e1fe 100644 --- a/index.js +++ b/index.js @@ -42,7 +42,7 @@ export default class Onboarding extends Component { render() { const { width, height } = Dimensions.get('window'); - const { pages, bottomOverlay, showSkip, showNext, showDone } = this.props; + const { pages, bottomOverlay, showSkip, showNext, showDone, skipText } = this.props; const currentPage = pages[this.state.currentPage] || pages[0]; const { backgroundColor } = currentPage; const isLight = tinycolor(backgroundColor).getBrightness() > 180; @@ -74,6 +74,7 @@ export default class Onboarding extends Component { Date: Mon, 9 Jul 2018 17:50:12 -0300 Subject: [PATCH 03/10] fix(skipText): default Skip as text --- components/Paginator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Paginator.js b/components/Paginator.js index 3692e09..c035658 100644 --- a/components/Paginator.js +++ b/components/Paginator.js @@ -10,7 +10,7 @@ const getDefaultStyle = (isLight) => ({ const SkipButton = ({ isLight, ...props }) => ( - {this.props.skipText || Skip} + {this.props.skipText || 'Skip'} ); From f27ba5aebca5f8fb82da2d6939b83aab729ab565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witalo=20Beni=CC=81cio?= Date: Mon, 9 Jul 2018 17:50:55 -0300 Subject: [PATCH 04/10] fix(skipText): right prop --- components/Paginator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Paginator.js b/components/Paginator.js index c035658..ea5ae16 100644 --- a/components/Paginator.js +++ b/components/Paginator.js @@ -30,7 +30,7 @@ const Paginator = ({ isLight, overlay, showSkip, showNext, showDone, pages, curr {showSkip && currentPage + 1 !== pages ? - : + : null } From 9e10d290237a69639d754b9ed869cc2aee9f6a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witalo=20Beni=CC=81cio?= Date: Mon, 9 Jul 2018 17:53:41 -0300 Subject: [PATCH 05/10] fix(skipText): prop in parameters --- components/Paginator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Paginator.js b/components/Paginator.js index ea5ae16..fa02e41 100644 --- a/components/Paginator.js +++ b/components/Paginator.js @@ -8,9 +8,9 @@ const getDefaultStyle = (isLight) => ({ color: isLight ? 'rgba(0, 0, 0, 0.8)' : '#fff', }); -const SkipButton = ({ isLight, ...props }) => ( +const SkipButton = ({ isLight, ...props, skipText }) => ( - {this.props.skipText || 'Skip'} + {skipText || 'Skip'} ); From 2ba420c4e6fc6754830e2a7932b7f192b55dac16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witalo=20Beni=CC=81cio?= Date: Wed, 5 Sep 2018 11:18:46 -0300 Subject: [PATCH 06/10] fix skipText --- components/Paginator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Paginator.js b/components/Paginator.js index fa02e41..d5dc07a 100644 --- a/components/Paginator.js +++ b/components/Paginator.js @@ -8,7 +8,7 @@ const getDefaultStyle = (isLight) => ({ color: isLight ? 'rgba(0, 0, 0, 0.8)' : '#fff', }); -const SkipButton = ({ isLight, ...props, skipText }) => ( +const SkipButton = ({ isLight, skipText, ...props }) => ( {skipText || 'Skip'} From 275bf0db581a676ac33c345622e487772b2561aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witalo=20Beni=CC=81cio?= Date: Tue, 11 Sep 2018 20:31:05 -0300 Subject: [PATCH 07/10] increasing subtitle font size --- components/PageData.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/PageData.js b/components/PageData.js index 2e6d13c..3c4cf77 100644 --- a/components/PageData.js +++ b/components/PageData.js @@ -54,7 +54,8 @@ const styles = { }, subtitle: { textAlign: 'center', - fontSize: 16, + fontSize: 20, + marginHorizontal: 16, color: 'rgba(255, 255, 255, 0.7)', }, subtitleLight: { From 4348a89cf6c1610cdb371c8215c8ddcb560d2363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witalo=20Beni=CC=81cio?= Date: Tue, 11 Sep 2018 22:14:04 -0300 Subject: [PATCH 08/10] font size --- .../a/7/a77b15c0d64cf6111e025645e562faf8ccabb9d7 | 2 ++ .../a/9/a90c3748aa79c6a0a3509686e634cae5084991d0 | 2 ++ .../c/a/ca67a0c9dcc2af5abc7c609231f2db528d528d14 | 0 .idea/sonarlint/issuestore/index.pb | 7 +++++++ components/PageData.js | 2 +- 5 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .idea/sonarlint/issuestore/a/7/a77b15c0d64cf6111e025645e562faf8ccabb9d7 create mode 100644 .idea/sonarlint/issuestore/a/9/a90c3748aa79c6a0a3509686e634cae5084991d0 create mode 100644 .idea/sonarlint/issuestore/c/a/ca67a0c9dcc2af5abc7c609231f2db528d528d14 create mode 100644 .idea/sonarlint/issuestore/index.pb diff --git a/.idea/sonarlint/issuestore/a/7/a77b15c0d64cf6111e025645e562faf8ccabb9d7 b/.idea/sonarlint/issuestore/a/7/a77b15c0d64cf6111e025645e562faf8ccabb9d7 new file mode 100644 index 0000000..f1cc774 --- /dev/null +++ b/.idea/sonarlint/issuestore/a/7/a77b15c0d64cf6111e025645e562faf8ccabb9d7 @@ -0,0 +1,2 @@ + +Ojavascript:S1128"0Remove this unused import of 'TouchableOpacity'.(ä彇üÿÿÿÿ \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/a/9/a90c3748aa79c6a0a3509686e634cae5084991d0 b/.idea/sonarlint/issuestore/a/9/a90c3748aa79c6a0a3509686e634cae5084991d0 new file mode 100644 index 0000000..b1c6c82 --- /dev/null +++ b/.idea/sonarlint/issuestore/a/9/a90c3748aa79c6a0a3509686e634cae5084991d0 @@ -0,0 +1,2 @@ + +Jjavascript:S1128"0Remove this unused import of 'TouchableOpacity'.(“ \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/c/a/ca67a0c9dcc2af5abc7c609231f2db528d528d14 b/.idea/sonarlint/issuestore/c/a/ca67a0c9dcc2af5abc7c609231f2db528d528d14 new file mode 100644 index 0000000..e69de29 diff --git a/.idea/sonarlint/issuestore/index.pb b/.idea/sonarlint/issuestore/index.pb new file mode 100644 index 0000000..8a3d80f --- /dev/null +++ b/.idea/sonarlint/issuestore/index.pb @@ -0,0 +1,7 @@ + +8 +index.js,a/7/a77b15c0d64cf6111e025645e562faf8ccabb9d7 +G +components/Paginator.js,a/9/a90c3748aa79c6a0a3509686e634cae5084991d0 +F +components/PageData.js,c/a/ca67a0c9dcc2af5abc7c609231f2db528d528d14 \ No newline at end of file diff --git a/components/PageData.js b/components/PageData.js index 3c4cf77..6b48c0f 100644 --- a/components/PageData.js +++ b/components/PageData.js @@ -54,7 +54,7 @@ const styles = { }, subtitle: { textAlign: 'center', - fontSize: 20, + fontSize: 18, marginHorizontal: 16, color: 'rgba(255, 255, 255, 0.7)', }, From 7a16810aabc075cc93bf50b7e77b6c20cccd92ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witalo=20Beni=CC=81cio?= Date: Wed, 17 Oct 2018 15:22:49 -0300 Subject: [PATCH 09/10] new(callback): onscroll --- .../issuestore/a/7/a77b15c0d64cf6111e025645e562faf8ccabb9d7 | 2 +- .../issuestore/a/9/a90c3748aa79c6a0a3509686e634cae5084991d0 | 2 +- components/PageData.js | 2 +- index.js | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.idea/sonarlint/issuestore/a/7/a77b15c0d64cf6111e025645e562faf8ccabb9d7 b/.idea/sonarlint/issuestore/a/7/a77b15c0d64cf6111e025645e562faf8ccabb9d7 index f1cc774..5fefbc5 100644 --- a/.idea/sonarlint/issuestore/a/7/a77b15c0d64cf6111e025645e562faf8ccabb9d7 +++ b/.idea/sonarlint/issuestore/a/7/a77b15c0d64cf6111e025645e562faf8ccabb9d7 @@ -1,2 +1,2 @@ -Ojavascript:S1128"0Remove this unused import of 'TouchableOpacity'.(ä彇üÿÿÿÿ \ No newline at end of file +Qjavascript:S1128"0Remove this unused import of 'TouchableOpacity'.(ä彇üÿÿÿÿ \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/a/9/a90c3748aa79c6a0a3509686e634cae5084991d0 b/.idea/sonarlint/issuestore/a/9/a90c3748aa79c6a0a3509686e634cae5084991d0 index b1c6c82..c718be8 100644 --- a/.idea/sonarlint/issuestore/a/9/a90c3748aa79c6a0a3509686e634cae5084991d0 +++ b/.idea/sonarlint/issuestore/a/9/a90c3748aa79c6a0a3509686e634cae5084991d0 @@ -1,2 +1,2 @@ -Jjavascript:S1128"0Remove this unused import of 'TouchableOpacity'.(“ \ No newline at end of file +Ljavascript:S1128"0Remove this unused import of 'TouchableOpacity'.(“ \ No newline at end of file diff --git a/components/PageData.js b/components/PageData.js index 6b48c0f..d572cbc 100644 --- a/components/PageData.js +++ b/components/PageData.js @@ -54,7 +54,7 @@ const styles = { }, subtitle: { textAlign: 'center', - fontSize: 18, + fontSize: 16, marginHorizontal: 16, color: 'rgba(255, 255, 255, 0.7)', }, diff --git a/index.js b/index.js index 159e1fe..6bbdfe5 100644 --- a/index.js +++ b/index.js @@ -21,8 +21,14 @@ export default class Onboarding extends Component { const page = Math.round(pageFraction); const isLastPage = this.props.pages.length === page + 1; if (isLastPage && pageFraction - page > 0.3) { + if (this.props.onScroll) { + this.props.onScroll(); + } this.props.onEnd(); } else { + if (this.props.onScroll) { + this.props.onScroll(); + } this.setState({ currentPage: page }); } }; From bf05f09823d5e68b4cb9ce3e207782b5daf1bf43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witalo=20Beni=CC=81cio?= Date: Wed, 13 Feb 2019 14:44:25 -0300 Subject: [PATCH 10/10] adding renderFooter --- components/PageData.js | 5 ++++- index.js | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/PageData.js b/components/PageData.js index d572cbc..819a5a0 100644 --- a/components/PageData.js +++ b/components/PageData.js @@ -15,7 +15,7 @@ const PageContent = ({ children }) => ( ); -const PageData = ({ isLight, image, title, subtitle, titleStyles, subtitleStyles, ...rest }) => ( +const PageData = ({ isLight, image, title, subtitle, titleStyles, subtitleStyles, renderFooter, ...rest }) => ( @@ -27,6 +27,9 @@ const PageData = ({ isLight, image, title, subtitle, titleStyles, subtitleStyles {subtitle} + { + renderFooter || null + } ); diff --git a/index.js b/index.js index 6bbdfe5..b850ccb 100644 --- a/index.js +++ b/index.js @@ -63,7 +63,7 @@ export default class Onboarding extends Component { onScroll={this.updatePosition} scrollEventThrottle={100} > - {pages.map(({ image, title, subtitle, titleStyles, subtitleStyles }, idx) => ( + {pages.map(({ image, title, subtitle, titleStyles, subtitleStyles, renderFooter }, idx) => ( ))} @@ -100,6 +101,7 @@ Onboarding.propTypes = { image: PropTypes.element.isRequired, title: PropTypes.string.isRequired, subtitle: PropTypes.string.isRequired, + renderFooter: PropTypes.element, })).isRequired, bottomOverlay: PropTypes.bool, showSkip: PropTypes.bool,