Created
February 17, 2020 09:45
-
-
Save techomoro/d3095f15313aa8cf6d8944698835d5ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import { Navigation, Footer, Header, WhatWeDo, Contact } from "./components"; | |
function App() { | |
let languageStoredInLocalStorage = localStorage.getItem("language"); | |
let [language, setLanguage] = useState( | |
languageStoredInLocalStorage ? languageStoredInLocalStorage : "English" | |
); | |
return ( | |
<div className="App"> | |
<Navigation | |
language={language} | |
handleSetLanguage={language => { | |
setLanguage(language); | |
storeLanguageInLocalStorage(language); | |
}} | |
/> | |
<Header language={language} /> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-8 mb-5"> | |
<WhatWeDo language={language} /> | |
</div> | |
<div class="col-md-4 mb-5"> | |
<Contact language={language} /> | |
</div> | |
</div> | |
</div> | |
<Footer language={language} /> | |
</div> | |
); | |
} | |
function storeLanguageInLocalStorage(language) { | |
localStorage.setItem("language", language); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment