-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathFontSize.js
More file actions
57 lines (50 loc) · 1.56 KB
/
FontSize.js
File metadata and controls
57 lines (50 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React from "react";
import {
Select,
Button,
Tooltip,
createTheme,
ThemeProvider,
Icon
} from "@material-ui/core";
import "../../css/KeyboardShortcut.css";
const fontTheme = createTheme({
palette: {
primary: {
main: "#9c27b0",
},
secondary: {
main: "#9c27b0",
}
},
});
const options=[12, 14, 18, 24, 30, 36, 48];
class FontSize extends React.Component {
handleFontSizeUpdate = (e) => {
this.props.userActions.updateFontSize(e.target.value);
}
render(){
return(
<div className="font">
<ThemeProvider theme={fontTheme}>
<Tooltip title="Font Size">
<Button className="font-button"
variant="contained"
size="small"
color="primary">
<Icon className="material-icons">format_size</Icon>
<Select className="select"
labelId="input-label"
defaultValue = {12}
value = {this.props.settings.fontSize}
onChange = {this.handleFontSizeUpdate}>
{options.map(size=>(<option value={size}>{size}</option>))}
</Select>
</Button>
</Tooltip>
</ThemeProvider>
</div>
);
}
}
export default FontSize;