react-insta-stories
react-insta-stories copied to clipboard
Fullscreen mode?
Is there a way to make the stories go in to a full screen mode?
These are hard coded in the global.ts at present, not had chance to dig too deep but it should be possible to create a more dynamic option.
.
I did this by doing the following:
constructor(props) {
super(props);
this.state = { width: 0, height: 0 };
this.updateWindowDimensions = this.updateWindowDimensions.bind(this);
}
componentDidMount() {
this.updateWindowDimensions();
window.addEventListener('resize', this.updateWindowDimensions);
}
componentWillUnmount() {
window.removeEventListener('resize', this.updateWindowDimensions);
}
updateWindowDimensions() {
let width = window.innerWidth
if(width <= 432) {
this.setState({ width: window.innerWidth, height: window.innerHeight });
}
else {
this.setState({ width: 432, height: 768 });
}
}