Skip to content

Commit

Permalink
11
Browse files Browse the repository at this point in the history
  • Loading branch information
zizdlp committed Oct 20, 2024
1 parent cef4a4d commit b04ae59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion zbook_frontend/src/editor/components/BlockMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class BlockMenu extends React.Component<BlockMenuProps> {

clearSearch = () => {
const { state, dispatch } = this.props.view;
const parent = findParentNode(node => !!node)(state.selection);
const parent = findParentNode((node) => !!node)(state.selection);

if (parent) {
dispatch(state.tr.insertText("", parent.pos, state.selection.to));
Expand Down
16 changes: 8 additions & 8 deletions zbook_frontend/src/editor/components/BlockMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ function BlockMenuItem({
const Icon = icon;

const ref = React.useCallback(
node => {
(node) => {
if (selected && node) {
scrollIntoView(node, {
scrollMode: "if-needed",
block: "center",
boundary: parent => {
boundary: (parent) => {
// All the parent elements of your target are checked until they
// reach the #block-menu-container. Prevents body and other parent
// elements from being scrolled
Expand Down Expand Up @@ -78,12 +78,12 @@ const MenuItem = styled.button<{
height: 36px;
cursor: pointer;
border: none;
opacity: ${props => (props.disabled ? ".5" : "1")};
color: ${props =>
opacity: ${(props) => (props.disabled ? ".5" : "1")};
color: ${(props) =>
props.selected
? props.theme.blockToolbarTextSelected
: props.theme.blockToolbarText};
background: ${props =>
background: ${(props) =>
props.selected
? props.theme.blockToolbarSelectedBackground ||
props.theme.blockToolbarTrigger
Expand All @@ -93,8 +93,8 @@ const MenuItem = styled.button<{
&:hover,
&:active {
color: ${props => props.theme.blockToolbarTextSelected};
background: ${props =>
color: ${(props) => props.theme.blockToolbarTextSelected};
background: ${(props) =>
props.selected
? props.theme.blockToolbarSelectedBackground ||
props.theme.blockToolbarTrigger
Expand All @@ -103,7 +103,7 @@ const MenuItem = styled.button<{
`;

const Shortcut = styled.span`
color: ${props => props.theme.textSecondary};
color: ${(props) => props.theme.textSecondary};
flex-grow: 1;
text-align: right;
`;
Expand Down

0 comments on commit b04ae59

Please sign in to comment.