Skip to content

Commit

Permalink
rm: document button changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pooja-bruno committed Jan 7, 2025
1 parent 5cf12ae commit 84b565f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import styled from 'styled-components';

const StyledWrapper = styled.div`
div.CodeMirror {
/* todo: find a better way */
height: calc(100vh - 240px);
.CodeMirror-scroll {
padding-bottom: 0px;
}
Expand Down
27 changes: 11 additions & 16 deletions packages/bruno-app/src/components/CollectionSettings/Docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,21 @@ const Docs = ({ collection }) => {

return (
<StyledWrapper className="mt-1 h-full w-full relative flex flex-col">
<div className="editing-mode mb-2 flex justify-between items-center" role="tab" onClick={toggleViewMode}>
<div className="editing-mode mb-2" role="tab" onClick={toggleViewMode}>
{isEditing ? 'Preview' : 'Edit'}
</div>

{isEditing ? (
<div className="flex-1 mt-2">
<CodeEditor
collection={collection}
theme={displayedTheme}
value={docs || ''}
onEdit={onEdit}
onSave={onSave}
mode="application/text"
font={get(preferences, 'font.codeFont', 'default')}
fontSize={get(preferences, 'font.codeFontSize')}
/>
<button type="submit" className="submit btn btn-sm btn-secondary my-4" onClick={onSave}>
Save
</button>
</div>
<CodeEditor
collection={collection}
theme={displayedTheme}
value={docs || ''}
onEdit={onEdit}
onSave={onSave}
mode="application/text"
font={get(preferences, 'font.codeFont', 'default')}
fontSize={get(preferences, 'font.codeFontSize')}
/>
) : (
<Markdown collectionPath={collection.pathname} onDoubleClick={toggleViewMode} content={docs} />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,21 @@ const Documentation = ({ collection, folder }) => {

return (
<StyledWrapper className="mt-1 h-full w-full relative flex flex-col">
<div className="editing-mode mb-2 flex justify-between items-center" role="tab" onClick={toggleViewMode}>
<div className="editing-mode mb-2" role="tab" onClick={toggleViewMode}>
{isEditing ? 'Preview' : 'Edit'}
</div>

{isEditing ? (
<div className="flex-1 mt-2">
<CodeEditor
collection={collection}
theme={displayedTheme}
value={docs || ''}
onEdit={onEdit}
onSave={onSave}
mode="application/text"
font={get(preferences, 'font.codeFont', 'default')}
fontSize={get(preferences, 'font.codeFontSize')}
/>
<button type="submit" className="submit btn btn-sm btn-secondary my-6" onClick={onSave}>
Save
</button>
</div>
<CodeEditor
collection={collection}
theme={displayedTheme}
value={docs || ''}
onEdit={onEdit}
onSave={onSave}
mode="application/text"
font={get(preferences, 'font.codeFont', 'default')}
fontSize={get(preferences, 'font.codeFontSize')}
/>
) : (
<Markdown collectionPath={collection.pathname} onDoubleClick={toggleViewMode} content={docs} />
)}
Expand Down

0 comments on commit 84b565f

Please sign in to comment.