-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #532 from jf-kelly/fontsize
Font Size
- Loading branch information
Showing
18 changed files
with
196 additions
and
34 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import * as types from "../constants/ActionTypes"; | ||
|
||
const googleLoginRef = "apiv1/googlelogins"; | ||
|
||
export function updateFontSize(fontSize){ | ||
return{ type: types.UPDATE_FONT_SIZE, fontSize }; | ||
} | ||
|
||
export function updateUserSettings(id,settings){ | ||
return ()=>{ | ||
if(id){ | ||
fetch(`${googleLoginRef}/settings`,{ | ||
method:"PUT", | ||
body:JSON.stringify(settings), | ||
headers: { | ||
"Content-Type":"application/json", | ||
"x-access-token":id | ||
} | ||
}); | ||
} | ||
}; | ||
} | ||
|
||
export function asyncUserSettings(id){ | ||
return dispatch => { | ||
if(id){ | ||
fetch(`${googleLoginRef}/settings`,{headers:{"x-access-token": id}}).then(response=>{ | ||
if(response.status === 200){ | ||
response.json().then(json =>{ | ||
dispatch(syncUserSettings(json)); | ||
}); | ||
} | ||
}); | ||
} | ||
}; | ||
} | ||
|
||
export function syncUserSettings(settings){ | ||
return { type: types.SYNC_USER_SETTINGS, settings: settings }; | ||
} | ||
|
||
export default { | ||
updateFontSize, | ||
asyncUserSettings, | ||
syncUserSettings, | ||
updateUserSettings | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from "react"; | ||
import { | ||
Select, | ||
Button, | ||
Tooltip, | ||
Icon | ||
} from "@material-ui/core"; | ||
import "../../css/KeyboardShortcut.css"; | ||
|
||
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"> | ||
<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> | ||
</div> | ||
); | ||
} | ||
} | ||
export default FontSize; | ||
|
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.