refactor: rename render-iframe to renderer-iframe

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-04-26 19:24:48 +02:00
parent aef0211092
commit 4d48aa613d
13 changed files with 21 additions and 21 deletions

View file

@ -6,9 +6,9 @@
import * as UseBaseUrlModule from '../../../hooks/common/use-base-url'
import { mockI18n } from '../../../test-utils/mock-i18n'
import { testId } from '../../../utils/test-id'
import * as RenderIframeModule from '../../common/render-iframe/render-iframe'
import type { CommonModalProps } from '../modals/common-modal'
import * as CommonModalModule from '../modals/common-modal'
import * as RendererIframeModule from '../renderer-iframe/renderer-iframe'
import * as fetchMotdModule from './fetch-motd'
import { MotdModal } from './motd-modal'
import { act, render, screen } from '@testing-library/react'
@ -17,7 +17,7 @@ import React from 'react'
jest.mock('./fetch-motd')
jest.mock('../modals/common-modal')
jest.mock('../../common/render-iframe/render-iframe')
jest.mock('../renderer-iframe/renderer-iframe')
jest.mock('../../../hooks/common/use-base-url')
describe('motd modal', () => {
@ -39,7 +39,7 @@ describe('motd modal', () => {
</span>
)
}) as React.FC<PropsWithChildren<CommonModalProps>>)
jest.spyOn(RenderIframeModule, 'RenderIframe').mockImplementation((props) => {
jest.spyOn(RendererIframeModule, 'RendererIframe').mockImplementation((props) => {
return (
<span {...testId('motd-renderer')}>
This is a mock implementation of a iframe renderer. Props: {JSON.stringify(props)}

View file

@ -9,7 +9,7 @@ import { testId } from '../../../utils/test-id'
import { EditorToRendererCommunicatorContextProvider } from '../../editor-page/render-context/editor-to-renderer-communicator-context-provider'
import { RendererType } from '../../render-page/window-post-message-communicator/rendering-message'
import { CommonModal } from '../modals/common-modal'
import { RenderIframe } from '../render-iframe/render-iframe'
import { RendererIframe } from '../renderer-iframe/renderer-iframe'
import { fetchMotd, MOTD_LOCAL_STORAGE_KEY } from './fetch-motd'
import React, { useCallback, useMemo, useEffect, useState } from 'react'
import { Button, Modal } from 'react-bootstrap'
@ -55,7 +55,7 @@ export const MotdModal: React.FC = () => {
{...cypressId('motd-modal')}>
<Modal.Body className={'bg-light'}>
<EditorToRendererCommunicatorContextProvider>
<RenderIframe
<RendererIframe
frameClasses={'w-100'}
rendererType={RendererType.SIMPLE}
markdownContentLines={lines as string[]}

View file

@ -28,7 +28,7 @@ import { useSendMarkdownToRenderer } from './hooks/use-send-markdown-to-renderer
import { useSendScrollState } from './hooks/use-send-scroll-state'
import React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react'
export interface RenderIframeProps extends Omit<CommonMarkdownRendererProps & ScrollProps, 'baseUrl'> {
export interface RendererIframeProps extends Omit<CommonMarkdownRendererProps & ScrollProps, 'baseUrl'> {
rendererType: RendererType
forcedDarkMode?: DarkModePreference
frameClasses?: string
@ -36,7 +36,7 @@ export interface RenderIframeProps extends Omit<CommonMarkdownRendererProps & Sc
adaptFrameHeightToContent?: boolean
}
const log = new Logger('RenderIframe')
const log = new Logger('RendererIframe')
/**
* Renders the iframe for the HTML-rendering of the markdown content.
@ -54,7 +54,7 @@ const log = new Logger('RenderIframe')
* @param adaptFrameHeightToContent If set, the iframe height will be adjusted to the content height
* @param onRendererStatusChange Callback that is fired when the renderer in the iframe is ready
*/
export const RenderIframe: React.FC<RenderIframeProps> = ({
export const RendererIframe: React.FC<RendererIframeProps> = ({
markdownContentLines,
scrollState,
onScroll,