From a08345b756f5ac20ccfb4b6fb98af5f281796e8b Mon Sep 17 00:00:00 2001 From: wrzesinski-hubert Date: Tue, 9 Jun 2020 16:27:32 +0200 Subject: [PATCH] poprawkiv2 --- src/App.tsx | 7 ++--- src/components/TopBar/index.tsx | 20 ++++++------ src/components/Transfer/index.scss | 50 +++++++++++++++++++++--------- src/components/Transfer/index.tsx | 13 ++++++-- 4 files changed, 59 insertions(+), 31 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 1d271d6..bf12808 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,7 +8,6 @@ import RightBar from "./components/RightBar"; function App() { const [isOpenTransfer, setOpenTransfer] = useState(false); - const [isPolish, setLanguage] = useState(true); const [text, setText] = useState(""); return ( @@ -20,11 +19,9 @@ function App() { handleTransfer={(e) => { setOpenTransfer(!isOpenTransfer); }} - handleLanguage={(e) => { - setLanguage(!isPolish); + onLangChange={(e) => { + console.log(e); }} - isOpenTransfer={isOpenTransfer} - isPolish={isPolish} /> void; - handleLanguage: (e: React.MouseEvent) => void; + onLangChange: (lang:boolean) => void; textChangeHandler: (e: React.ChangeEvent) => void; - isOpenTransfer: boolean; - isPolish: boolean; - } interface TopBarState { isOpenProfile: boolean; anchorEl: null | HTMLElement; + isPolish: boolean; } export default class TopBar extends React.Component { @@ -29,11 +27,12 @@ export default class TopBar extends React.Component { super(props); this.handleProfile = this.handleProfile.bind(this); this.handleClose = this.handleClose.bind(this); - this.handleLanguage = this.handleLanguage.bind(this); + this.onLangChange = this.onLangChange.bind(this); this.handleTransfer = this.handleTransfer.bind(this); this.state = { isOpenProfile: false, anchorEl:null, + isPolish:true, }; } @@ -45,8 +44,11 @@ export default class TopBar extends React.Component { this.props.handleTransfer(e); } - handleLanguage(e: React.MouseEvent) { - this.props.handleLanguage(e); + onLangChange(e: React.MouseEvent) { + this.setState({ + isPolish:!this.state.isPolish, + }) + this.props.onLangChange(this.state.isPolish); } handleProfile(e: React.MouseEvent) { @@ -95,8 +97,8 @@ export default class TopBar extends React.Component { change_language
- +
+
Oddam
+ +
+
+
PrzyjmÄ™
+ +
+
+