Skip to content
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

Removed width and height as Page props #127

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ const Page = ({
image,
title,
subtitle,
width,
height,
containerStyles,
imageContainerStyles,
allowFontScaling,
Expand Down Expand Up @@ -38,7 +36,7 @@ const Page = ({
}

return (
<View style={[styles.container, containerStyles, { width, height }]}>
<View style={[styles.container, containerStyles]}>
<View style={[styles.imageContainer, imageContainerStyles]}>{image}</View>
{titleElement}
{subtitleElement}
Expand All @@ -65,8 +63,6 @@ Page.propTypes = {
subTitleStyles: PropTypes.shape({
style: PropTypes.any,
}),
width: PropTypes.number.isRequired,
height: PropTypes.number.isRequired,
};

Page.defaultProps = {
Expand Down
8 changes: 2 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class Onboarding extends Component {
this.state = {
currentPage: 0,
previousPage: null,
width: null,
height: null,
backgroundColorAnim: new Animated.Value(0),
};
}
Expand Down Expand Up @@ -76,8 +74,8 @@ class Onboarding extends Component {
};

_onLayout = () => {
const { width, height } = Dimensions.get('window');
this.setState({ width, height });
// const { width, height } = Dimensions.get('window');
// this.setState({ width, height });
};

keyExtractor = (item, index) => index.toString();
Expand All @@ -99,8 +97,6 @@ class Onboarding extends Component {
image={image}
title={title}
subtitle={subtitle}
width={this.state.width || Dimensions.get('window').width}
height={this.state.height || Dimensions.get('window').height}
containerStyles={containerStyles}
imageContainerStyles={imageContainerStyles}
allowFontScaling={allowFontScalingText}
Expand Down