Skip to content

Commit

Permalink
chore: add keyboard shortcut hint text for different OS
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjai0py committed Feb 15, 2024
1 parent bcc5897 commit 6ca05d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/bruno-app/src/components/CodeEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ export default class CodeEditor extends React.Component {
if (this.props.onPrettify) {
this.props.onPrettify();
}
},
'Meta-Alt-F': () => {
if (this.props.onPrettify) {
this.props.onPrettify();
}
}
},
foldOptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { humanizeRequestBodyMode } from 'utils/collections';
import StyledWrapper from './StyledWrapper';
import { updateRequestBody } from 'providers/ReduxStore/slices/collections/index';
import { toastError } from 'utils/common/error';
import { isMacOS, isWindowsOS } from 'utils/common/platform';

const RequestBodyMode = ({ item, collection }) => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -125,7 +126,11 @@ const RequestBodyMode = ({ item, collection }) => {
</Dropdown>
</div>
{bodyMode === 'json' && (
<button title="Prettify (Shift+Alt+F)" className="ml-1" onClick={onPrettify}>
<button
title={`Prettify ${isWindowsOS ? '(Shift+Alt+F)' : isMacOS ? '(Meta-Alt-F)' : ''}`}
className="ml-1"
onClick={onPrettify}
>
Prettify
</button>
)}
Expand Down

0 comments on commit 6ca05d3

Please sign in to comment.