Quote is nullable, fix style issues in notebooks

This commit is contained in:
Jackson Harper 2023-03-27 10:17:33 +08:00
parent af708d68a2
commit 53e5d9c6a0
6 changed files with 6 additions and 6 deletions

View file

@ -256,7 +256,7 @@ export function MarkdownNote(props: MarkdownNote): JSX.Element {
p: '10px',
width: '100%',
marginTop: '15px',
color: '$thHighContrast',
color: '#3D3D3D',
bg: '#F5F5F5',
'> *': {
m: '0px',

View file

@ -31,7 +31,7 @@ export function HighlightView(props: HighlightViewProps): JSX.Element {
const [isEditing, setIsEditing] = useState(false)
const lines = useMemo(
() => props.highlight.quote.split('\n'),
() => (props.highlight.quote || '').split('\n'),
[props.highlight.quote]
)

View file

@ -518,7 +518,7 @@ export function HighlightsLayer(props: HighlightsLayerProps): JSX.Element {
}
const copy = async () => {
if (focusedHighlight) {
if (focusedHighlight && focusedHighlight.quote) {
if (window.AndroidWebKitMessenger) {
window.AndroidWebKitMessenger.handleIdentifiableMessage(
'writeToClipboard',

View file

@ -316,7 +316,7 @@ export function NotebookModal(props: NotebookModalProps): JSX.Element {
top: '0px',
height: '50px',
p: '20px',
bg: '$thBackground',
bg: '$grayBg',
zIndex: 10,
}}
>

View file

@ -49,7 +49,7 @@ export function HighlightItem(props: HighlightItemProps): JSX.Element {
const [isEditing, setIsEditing] = useState(false)
const lines = useMemo(
() => props.highlight.quote.split('\n'),
() => (props.highlight.quote || '').split('\n'),
[props.highlight.quote]
)

View file

@ -31,7 +31,7 @@ export type Highlight = {
id: string
type: HighlightType
shortId: string
quote: string
quote?: string
prefix?: string
suffix?: string
patch: string