🚧 Ongoing work on components and pattern info
This commit is contained in:
parent
a3ae718632
commit
ea41dc0106
168 changed files with 17518 additions and 14384 deletions
49
packages/components/src/Workbench/LanguageChooser/index.js
Normal file
49
packages/components/src/Workbench/LanguageChooser/index.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
import React from "react";
|
||||
import Button from "@material-ui/core/Button";
|
||||
import { i18n } from "@freesewing/i18n";
|
||||
|
||||
const LanguageChooser = props => {
|
||||
const styles = {
|
||||
container: {
|
||||
display: "flex",
|
||||
height: "calc(100vh - 64px)",
|
||||
width: "100%"
|
||||
},
|
||||
chooser: {
|
||||
width: "100%",
|
||||
textAlign: "center",
|
||||
alignSelf: "center"
|
||||
},
|
||||
button: {
|
||||
margin: "1rem"
|
||||
}
|
||||
};
|
||||
|
||||
const changeLanguage = lang => {
|
||||
props.setLanguage(lang);
|
||||
props.setDisplay("pattern");
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={styles.container}>
|
||||
<div style={styles.chooser}>
|
||||
{Object.keys(i18n).map(lang => {
|
||||
return (
|
||||
<Button
|
||||
style={styles.button}
|
||||
key={lang}
|
||||
color="primary"
|
||||
size="large"
|
||||
variant="contained"
|
||||
onClick={() => changeLanguage(lang)}
|
||||
>
|
||||
{i18n[lang][lang]}
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default LanguageChooser;
|
Loading…
Add table
Add a link
Reference in a new issue