fix style css in ts
This commit is contained in:
@@ -2,6 +2,7 @@ import { Check, CopyIcon, Loader2 } from 'lucide-react'
|
||||
import { PropsWithChildren, useMemo, useState } from 'react'
|
||||
|
||||
import { useDarkModeContext } from '../../contexts/DarkModeContext'
|
||||
import { InfioBlockAction } from '../../utils/parse-infio-block'
|
||||
|
||||
import { MemoizedSyntaxHighlighterWrapper } from './SyntaxHighlighterWrapper'
|
||||
|
||||
@@ -26,7 +27,7 @@ export default function MarkdownActionBlock({
|
||||
filename?: string
|
||||
startLine?: number
|
||||
endLine?: number
|
||||
action?: 'edit' | 'new' | 'reference'
|
||||
action?: InfioBlockAction
|
||||
}>) {
|
||||
const [copied, setCopied] = useState(false)
|
||||
const { isDarkMode } = useDarkModeContext()
|
||||
@@ -67,7 +68,7 @@ export default function MarkdownActionBlock({
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
{action === 'edit' && (
|
||||
{action === InfioBlockAction.Edit && (
|
||||
<button
|
||||
onClick={() => {
|
||||
onApply({
|
||||
@@ -88,7 +89,7 @@ export default function MarkdownActionBlock({
|
||||
)}
|
||||
</button>
|
||||
)}
|
||||
{action === 'new' && (
|
||||
{action === InfioBlockAction.New && (
|
||||
<button
|
||||
onClick={() => {
|
||||
onApply({
|
||||
|
||||
@@ -2,7 +2,8 @@ import React, { useMemo } from 'react'
|
||||
import Markdown from 'react-markdown'
|
||||
|
||||
import {
|
||||
ParsedinfioBlock,
|
||||
InfioBlockAction,
|
||||
ParsedInfioBlock,
|
||||
parseinfioBlocks,
|
||||
} from '../../utils/parse-infio-block'
|
||||
|
||||
@@ -23,7 +24,7 @@ function ReactMarkdown({
|
||||
children: string
|
||||
isApplying: boolean
|
||||
}) {
|
||||
const blocks: ParsedinfioBlock[] = useMemo(
|
||||
const blocks: ParsedInfioBlock[] = useMemo(
|
||||
() => parseinfioBlocks(children),
|
||||
[children],
|
||||
)
|
||||
@@ -35,7 +36,7 @@ function ReactMarkdown({
|
||||
<Markdown key={index} className="infio-markdown">
|
||||
{block.content}
|
||||
</Markdown>
|
||||
) : block.startLine && block.endLine && block.filename && block.action === 'reference' ? (
|
||||
) : block.startLine && block.endLine && block.filename && block.action === InfioBlockAction.Reference ? (
|
||||
<MarkdownReferenceBlock
|
||||
key={index}
|
||||
filename={block.filename}
|
||||
|
||||
@@ -538,9 +538,8 @@ export function useMenuAnchorRef(
|
||||
containerDiv.setAttribute('aria-label', 'Typeahead menu')
|
||||
containerDiv.setAttribute('id', 'typeahead-menu')
|
||||
containerDiv.setAttribute('role', 'listbox')
|
||||
containerDiv.style.display = 'block'
|
||||
containerDiv.style.position = 'absolute'
|
||||
parent.append(containerDiv)
|
||||
containerDiv.classList.add('infio-utils-lexical-menu-container')
|
||||
parent.append(containerDiv)
|
||||
}
|
||||
anchorElementRef.current = containerDiv
|
||||
rootElement.setAttribute('aria-controls', 'typeahead-menu')
|
||||
|
||||
Reference in New Issue
Block a user