Skip to content

Commit

Permalink
Toolbar is hidden while publishing an article (#682)
Browse files Browse the repository at this point in the history
* Toolbar is hidden while publishing an article

* removed additional logic and adjusted z-index
  • Loading branch information
danboyce92 authored Jan 3, 2024
1 parent 0d51459 commit c813672
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.sticky {
position: sticky;
top: 0;
z-index: 50;
z-index: 10;
width: 100%;
margin-bottom: 1em;
}

.flex {
display: flex;
justify-content: space-between;
Expand Down Expand Up @@ -98,3 +98,5 @@ input:checked + .slider::before {
visibility: 1;
opacity: 1;
}


4 changes: 2 additions & 2 deletions components/editor/editor/components/Toolbar/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface ToolbarItem {
command: () => void;
icon: typeof BoldIcon;
}

function Toolbar({ editor }: ToolbarProps) {
const [isOpen, setIsOpen] = useState(true);
const [, setIsTableEditing] = useState(false);
Expand Down Expand Up @@ -72,7 +72,7 @@ function Toolbar({ editor }: ToolbarProps) {
};

return (
<div className={`${styles.sticky} bg-neutral-900`}>
<div className={`${styles.sticky} bg-neutral-900 mb-4`}>
<ImageDetailsModal
isImageDetailsModalOpen={isImageDetailsModalOpen}
setIsImageDetailsModalOpen={setIsImageDetailsModalOpen}
Expand Down
2 changes: 1 addition & 1 deletion components/editor/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CustomCodeBlockEdit, TiptapExtensions } from "./extensions";
import { EditorBubbleMenu } from "./components/bubble-menu";
import { MediaResizer } from "./components/image-resizer";
import Toolbar from "./components/Toolbar/Toolbar";

interface EditorProps {
initialValue: string;
onChange: (value: string) => void;
Expand Down

0 comments on commit c813672

Please sign in to comment.