diff --git a/src/App.tsx b/src/App.tsx index e9f6229..c4a7b63 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,9 +13,15 @@ function App() { textChangeHandler={(e) => { setText(e.target.value); }} - handleOpen={(e) => { + handleTransfer={(e) => { setOpen(!isOpen); }} + handleLanguage={(e)=>{ + alert("chuj1"); + }} + handleProfile={(e)=>{ + alert("chuj2"); + }} isOpen={isOpen} /> void; + handleTransfer: (e: React.MouseEvent) => void; + handleProfile: (e: React.MouseEvent) => void; + handleLanguage: (e: React.MouseEvent) => void; textChangeHandler: (e: React.ChangeEvent) => void; isOpen: boolean; } @@ -15,15 +17,16 @@ interface TopBarState {} export default class TopBar extends React.Component { constructor(props: TopBarProps) { super(props); - - this.handleOpen = this.handleOpen.bind(this); + this.handleProfile = this.handleProfile.bind(this); + this.handleLanguage = this.handleLanguage.bind(this); + this.handleTransfer = this.handleTransfer.bind(this); this.state = { isOpen: false, }; } - handleOpen(e: React.MouseEvent) { - this.props.handleOpen(e); + handleTransfer(e: React.MouseEvent) { + this.props.handleTransfer(e); this.setState({ isOpen: true, }); @@ -33,8 +36,12 @@ export default class TopBar extends React.Component { this.props.textChangeHandler(e); } - funkcja() { - alert("chuj"); + handleProfile(e: React.MouseEvent) { + this.props.handleProfile(e); + } + + handleLanguage(e: React.MouseEvent) { + this.props.handleLanguage(e); } render() { @@ -65,19 +72,19 @@ export default class TopBar extends React.Component { className="top-bar__icon" alt="transfer" src="https://plannaplan.pl/img/transfer.png" - onClick={this.handleOpen} + onClick={this.handleTransfer} /> change_language profile