Skip to content

Commit

Permalink
refactor: update for patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 22, 2023
1 parent 4445391 commit 6ce02c6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
3 changes: 2 additions & 1 deletion components/editor/intelli/menu/menu-bubble.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BubbleMenu } from '@tiptap/react'
import React from 'react'
import { MagicWandIcon } from '@radix-ui/react-icons'

export const MenuBubble = ({ editor }) => {
const selection = editor.commands.getSelectedText()
Expand All @@ -12,7 +13,7 @@ export const MenuBubble = ({ editor }) => {
value="left" aria-label="Left aligned"
className={editor.isActive('bold') ? 'is-active BubbleMenuItem' : 'BubbleMenuItem'}
>
优化表达
<MagicWandIcon /> 优化表达
</button>
}
</BubbleMenu>
Expand Down
19 changes: 15 additions & 4 deletions pages/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ button {
}

.ToggleGroup {
display: inline-flex;
background-color: var(--mauve-6);
display: flex;
border-radius: 4px;
box-shadow: 0 2px 2px var(--black-a7);
justify-content: center;
}

.ToggleGroupItem {
cursor: pointer;
background-color: white;
color: var(--mauve-11);
height: 35px;
Expand All @@ -73,6 +73,7 @@ button {
align-items: center;
justify-content: center;
margin-left: 1px;
box-shadow: 0 2px 2px var(--black-a7);
}

.ToggleGroupItem:first-child {
Expand Down Expand Up @@ -102,7 +103,17 @@ button {

.BubbleMenuItem {
padding: 0.5em;
color: var(--mauve-11);
background: #fff;
border-radius: 4px;
color: #000;
box-shadow: 0 2px 2px var(--black-a7);
cursor: pointer;
}

.BubbleMenuItem svg {
color: var(--violet-11);
font-weight: bold;
display: inline;
}

:root {
Expand Down
2 changes: 1 addition & 1 deletion styles/Home.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
height: 1em;
}

@media (max-width: 800px) {
@media (max-width: 600px) {
.grid {
width: 100%;
flex-direction: column;
Expand Down
1 change: 1 addition & 0 deletions styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ input {
padding-left: 25px;
user-select: none;
outline: none;
cursor: pointer;
}

.DropdownMenuSubTrigger[data-state='open'] {
Expand Down

0 comments on commit 6ce02c6

Please sign in to comment.