@@ -8,7 +8,7 @@ import { useTransition, EditorStep } from "./editor-shift"
88import { CodeConfig } from "../smooth-code"
99import { useLayoutEffect } from "../utils"
1010import { CopyButton } from "smooth-code/copy-button"
11- import { ExpandButton } from "smooth-code /expand-button"
11+ import { ExpandButton } from "mini-editor /expand-button"
1212
1313export { EditorTransition , EditorTween }
1414export type { EditorTransitionProps , EditorTweenProps }
@@ -56,7 +56,8 @@ function EditorTween({
5656} : EditorTweenProps ) {
5757 const ref = React . createRef < HTMLDivElement > ( )
5858
59- const { showCopyButton, ...config } = codeConfig
59+ const { showCopyButton, showExpandButton, ...config } =
60+ codeConfig
6061 const {
6162 northPanel,
6263 southPanel,
@@ -95,6 +96,31 @@ function EditorTween({
9596 framePropsWithHeight . style . maxHeight = frozenHeight
9697 }
9798
99+ const northButtons = (
100+ < >
101+ { showCopyButton ? (
102+ < CopyButton
103+ content = { northContent }
104+ style = { { marginRight : "0.8em" } }
105+ />
106+ ) : undefined }
107+ { showExpandButton ? (
108+ < ExpandButton
109+ style = { { marginRight : "0.8em" } }
110+ step = { next || prev }
111+ theme = { codeConfig . theme }
112+ />
113+ ) : undefined }
114+ </ >
115+ )
116+
117+ const southCopyButton = showCopyButton ? (
118+ < CopyButton
119+ content = { southContent }
120+ style = { { marginRight : "0.8em" } }
121+ />
122+ ) : undefined
123+
98124 const terminalPanel = (
99125 < TerminalPanel
100126 prev = { prev . terminal }
@@ -111,17 +137,8 @@ function EditorTween({
111137 southPanel = { southPanel }
112138 terminalPanel = { terminalPanel }
113139 theme = { codeConfig . theme }
114- northButton = {
115- < ExpandButton style = { { margin : "0 0.8em" } } />
116- }
117- southButton = {
118- showCopyButton ? (
119- < CopyButton
120- content = { southContent }
121- style = { { margin : "0 0.8em" } }
122- />
123- ) : undefined
124- }
140+ northButton = { northButtons }
141+ southButton = { southCopyButton }
125142 />
126143 )
127144}
0 commit comments