I have a react component that renders a div with some containing menu item elements - inline-block (all horizontally aligned)
with text "Toy Store", "Configure your Toy", "About Us"
So how does one accomplish this: When the window size changes i dont want the items to stack upon each other, but first change the manu text to "Toys", "Configure" and "About" just at the point when the parent element couldn't keep them in one line because its not wide enough anymore (not on a fixed window breakpoint). When space gets even too narrow for that change text to "T", "C", "A" (dont question why, it should be like this)
So since this is not only a style change but also content, how can this be done with a react element?
render () {
const { theme } = this.props;
const { classes } = this.props;
return(
<div style={{flex: 1}}>
<Button color="inherit" variant={this.state.btnVar0} onClick={(e) => this.toggleMenuBtns(0,e)}><span className = {classes.menuButtonMed} >T{this.state.squeeze > 1 ? null : <span >oy</span>}</span>{this.state.squeeze > 0 ? null : <span> Store</ span>}</Button>
<Button color="inherit" variant={this.state.btnVar1} onClick={(e) => this.toggleMenuBtns(1,e)}><span className = {classes.menuButtonTreat}>C{this.state.squeeze > 1 ? null : <span>onfigure</span>}</span>{this.state.squeeze > 0 ? null : <span> your Toy</span>}</Button>
<Button color="inherit" variant={this.state.btnVar2} onClick={(e) => this.toggleMenuBtns(2,e)}><span className = {classes.menuButtonCom} >A{this.state.squeeze > 1 ? null : <span >bout</span>}</span>{this.state.squeeze > 0 ? null : <span> Us</ span>}</Button>
</div>
);
}