forked from usebruno/bruno
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:usebruno/bruno
- Loading branch information
Showing
26 changed files
with
326 additions
and
206 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
7 changes: 7 additions & 0 deletions
7
packages/bruno-app/src/components/Preferences/Font/StyledWrapper.js
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,7 @@ | ||
import styled from 'styled-components'; | ||
|
||
const StyledWrapper = styled.div` | ||
color: ${(props) => props.theme.text}; | ||
`; | ||
|
||
export default StyledWrapper; |
55 changes: 55 additions & 0 deletions
55
packages/bruno-app/src/components/Preferences/Font/index.js
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,55 @@ | ||
import React, { useState } from 'react'; | ||
import get from 'lodash/get'; | ||
import { useSelector, useDispatch } from 'react-redux'; | ||
import { savePreferences } from 'providers/ReduxStore/slices/app'; | ||
import StyledWrapper from './StyledWrapper'; | ||
|
||
const Font = ({ close }) => { | ||
const dispatch = useDispatch(); | ||
const preferences = useSelector((state) => state.app.preferences); | ||
|
||
const [codeFont, setCodeFont] = useState(get(preferences, 'font.codeFont', 'default')); | ||
|
||
const handleInputChange = (event) => { | ||
setCodeFont(event.target.value); | ||
}; | ||
|
||
const handleSave = () => { | ||
dispatch( | ||
savePreferences({ | ||
...preferences, | ||
font: { | ||
codeFont | ||
} | ||
}) | ||
).then(() => { | ||
close(); | ||
}); | ||
}; | ||
|
||
return ( | ||
<StyledWrapper> | ||
<label className="block font-medium">Code Editor Font</label> | ||
<div className="input-container"> | ||
<input | ||
type="text" | ||
className="block textbox mt-2 w-full" | ||
autoComplete="off" | ||
autoCorrect="off" | ||
autoCapitalize="off" | ||
spellCheck="false" | ||
onChange={handleInputChange} | ||
defaultValue={codeFont} | ||
/> | ||
</div> | ||
|
||
<div className="mt-10"> | ||
<button type="submit" className="submit btn btn-sm btn-secondary" onClick={handleSave}> | ||
Save | ||
</button> | ||
</div> | ||
</StyledWrapper> | ||
); | ||
}; | ||
|
||
export default Font; |
51 changes: 31 additions & 20 deletions
51
packages/bruno-app/src/components/Preferences/General/index.js
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
File renamed without changes.
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.