mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-03 04:29:09 +01:00
add: document save button
This commit is contained in:
parent
b9ec0acab4
commit
34ea352e4e
@ -8,6 +8,7 @@ import { saveCollectionRoot } from 'providers/ReduxStore/slices/collections/acti
|
||||
import Markdown from 'components/MarkDown';
|
||||
import CodeEditor from 'components/CodeEditor';
|
||||
import StyledWrapper from './StyledWrapper';
|
||||
import { IconDeviceFloppy } from '@tabler/icons';
|
||||
|
||||
const Docs = ({ collection }) => {
|
||||
const dispatch = useDispatch();
|
||||
@ -15,6 +16,7 @@ const Docs = ({ collection }) => {
|
||||
const [isEditing, setIsEditing] = useState(false);
|
||||
const docs = get(collection, 'root.docs', '');
|
||||
const preferences = useSelector((state) => state.app.preferences);
|
||||
const { theme, storedTheme } = useTheme();
|
||||
|
||||
const toggleViewMode = () => {
|
||||
setIsEditing((prev) => !prev);
|
||||
@ -33,8 +35,13 @@ const Docs = ({ collection }) => {
|
||||
|
||||
return (
|
||||
<StyledWrapper className="mt-1 h-full w-full relative">
|
||||
<div className="editing-mode mb-2" role="tab" onClick={toggleViewMode}>
|
||||
<div className="editing-mode mb-2 flex justify-between items-center" role="tab" onClick={toggleViewMode}>
|
||||
{isEditing ? 'Preview' : 'Edit'}
|
||||
{isEditing ?
|
||||
<button onClick={onSave}>
|
||||
<IconDeviceFloppy color={theme.requestTabs.icon.color} />
|
||||
</button>
|
||||
: null}
|
||||
</div>
|
||||
|
||||
{isEditing ? (
|
||||
|
Loading…
Reference in New Issue
Block a user