Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvicenti committed Oct 17, 2023
1 parent 376953e commit e2334fe
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions dev
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def main():
def run_desktop(args):
run("./scripts/cleanup-desktop.sh")
run("yarn install")
run("yarn workspace @mintter/ui generate")
run("plz build //backend:mintterd //:yarn")
return run("yarn desktop", args=args)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@ import {readFileSync} from 'fs'
import {join} from 'path'
import {serverHelpers} from 'server/ssr-helpers'
import {OG_IMAGE_SIZE} from 'server/content-image-meta'
import {
HMBlockChildrenType,
InlineContent,
createHmId,
serverBlockToEditorInline,
} from '@mintter/shared'
import {
HMAccount,
HMBlock,
HMBlockChildrenType,
HMBlockNode,
HMGroup,
HMPublication,
} from 'server/json-hm'
createHmId,
toHMInlineContent,
} from '@mintter/shared'

import {ReactElement} from 'react'
import {InlineContent} from '@mintter/editor'

function loadFont(fileName: string) {
const path = join(process.cwd(), 'font', fileName)
Expand Down Expand Up @@ -69,7 +68,7 @@ function ParagraphBlockDisplay({
block: HMBlock
childrenType: HMBlockChildrenType
}) {
const inlineContent = serverBlockToEditorInline(block)
const inlineContent = toHMInlineContent(block)
return (
<div
style={{
Expand All @@ -89,7 +88,7 @@ function HeadingBlockDisplay({
block: HMBlock
childrenType: HMBlockChildrenType
}) {
const inlineContent = serverBlockToEditorInline(block)
const inlineContent = toHMInlineContent(block)
return (
<div
style={{
Expand Down
6 changes: 3 additions & 3 deletions frontend/packages/shared/src/client/to-hm-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ function annotationStyle(a: Annotation): HMStyles {
}

export function toHMInlineContent(block: Block): Array<HMInlineContent> {
const linkAnnotations = block.annotations.filter((a) => a.type === 'link')
if (!linkAnnotations.length) {
const linkAnnotations = block.annotations?.filter((a) => a.type === 'link')
if (!linkAnnotations?.length) {
return partialBlockToStyledText(block)
}
if (
Expand Down Expand Up @@ -130,7 +130,7 @@ export function partialBlockToStyledText({
const inlines: HMStyles[] = []
const allStyleKeys = new Set<string>()

annotations.forEach((annotation) => {
annotations?.forEach((annotation) => {
const {starts, ends} = annotation
const annotationStyles = annotationStyle(annotation)
Object.keys(annotationStyles).forEach((key) => allStyleKeys.add(key))
Expand Down
3 changes: 2 additions & 1 deletion scripts/cleanup-frontend.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rm yarn.lock \; 2>/dev/null || true
find . -type d -name "node_modules" -exec rm -r {} \; 2>/dev/null || true
find . -type d -name ".tamagui" -exec rm -r {} \; 2>/dev/null || true
find . -type d -name ".tamagui" -exec rm -r {} \; 2>/dev/null || true
rm frontend/packages/ui/src/themes-generated.ts

0 comments on commit e2334fe

Please sign in to comment.