Skip to content

Commit

Permalink
refactor(web): import StaticMath from package
Browse files Browse the repository at this point in the history
  • Loading branch information
elbotho committed Jan 9, 2025
1 parent f153c36 commit d255e57
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
6 changes: 2 additions & 4 deletions apps/web/src/components/comments/comment.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StaticMathProps } from '@editor/plugins/text/static-components/static-math'
import type { StaticMathProps } from '@editor/package'
import dynamic from 'next/dynamic'
import { useEffect, useRef, useState } from 'react'

Expand All @@ -23,9 +23,7 @@ interface CommentProps {
}

const StaticMath = dynamic<StaticMathProps>(() =>
import('@editor/plugins/text/static-components/static-math').then(
(mod) => mod.StaticMath
)
import('@editor/package').then((mod) => mod.StaticMath)
)

export function Comment({
Expand Down
6 changes: 2 additions & 4 deletions apps/web/src/components/equations-app/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StaticMathProps } from '@editor/plugins/text/static-components/static-math'
import type { StaticMathProps } from '@editor/package'
import { faCheck, faPlay } from '@fortawesome/free-solid-svg-icons'
import dynamic from 'next/dynamic'

Expand All @@ -12,9 +12,7 @@ interface OverviewProps {
}

const StaticMath = dynamic<StaticMathProps>(() =>
import('@editor/plugins/text/static-components/static-math').then(
(mod) => mod.StaticMath
)
import('@editor/package').then((mod) => mod.StaticMath)
)

export function Overview({ selectLevel, solved }: OverviewProps) {
Expand Down
6 changes: 2 additions & 4 deletions apps/web/src/components/user/event.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StaticMathProps } from '@editor/plugins/text/static-components/static-math'
import type { StaticMathProps } from '@editor/package'
import { faBellSlash, faCheck } from '@fortawesome/free-solid-svg-icons'
import { Entity } from '@serlo/authorization'
import Tippy from '@tippyjs/react'
Expand Down Expand Up @@ -39,9 +39,7 @@ interface EventProps {
}

const StaticMath = dynamic<StaticMathProps>(() =>
import('@editor/plugins/text/static-components/static-math').then(
(mod) => mod.StaticMath
)
import('@editor/package').then((mod) => mod.StaticMath)
)

export function Event({
Expand Down
7 changes: 3 additions & 4 deletions apps/web/src/serlo-editor-integration/create-renderers.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { StaticMathProps } from '@editor/package'
import {
InitRenderersArgs,
LinkRenderer,
Expand Down Expand Up @@ -117,10 +118,8 @@ const HighlightStaticRenderer = dynamic<EditorHighlightDocument>(() =>
(mod) => mod.HighlightStaticRenderer
)
)
const StaticMath = dynamic<MathElement>(() =>
import('@editor/plugins/text/static-components/static-math').then(
(mod) => mod.StaticMath
)
const StaticMath = dynamic<StaticMathProps>(() =>
import('@editor/package').then((mod) => mod.StaticMath)
)

export function createRenderers(): InitRenderersArgs {
Expand Down

0 comments on commit d255e57

Please sign in to comment.