From 46668a6bdbefd801c21b8ca4543596b8efd47fd4 Mon Sep 17 00:00:00 2001 From: wrzesinski-hubert Date: Wed, 3 Jun 2020 18:15:51 +0200 Subject: [PATCH] zmiany guziki klasy i stara szafa --- src/App.tsx | 8 +++++++- src/components/TopBar/index.scss | 19 ++++++++++++++++--- src/components/TopBar/index.tsx | 27 +++++++++++++++++---------- 3 files changed, 40 insertions(+), 14 deletions(-) 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