@@ -8,7 +8,7 @@ import { useTransition, EditorStep } from "./editor-shift"
8
8
import { CodeConfig } from "../smooth-code"
9
9
import { useLayoutEffect } from "../utils"
10
10
import { CopyButton } from "smooth-code/copy-button"
11
- import { ExpandButton } from "smooth-code /expand-button"
11
+ import { ExpandButton } from "mini-editor /expand-button"
12
12
13
13
export { EditorTransition , EditorTween }
14
14
export type { EditorTransitionProps , EditorTweenProps }
@@ -56,7 +56,8 @@ function EditorTween({
56
56
} : EditorTweenProps ) {
57
57
const ref = React . createRef < HTMLDivElement > ( )
58
58
59
- const { showCopyButton, ...config } = codeConfig
59
+ const { showCopyButton, showExpandButton, ...config } =
60
+ codeConfig
60
61
const {
61
62
northPanel,
62
63
southPanel,
@@ -95,6 +96,31 @@ function EditorTween({
95
96
framePropsWithHeight . style . maxHeight = frozenHeight
96
97
}
97
98
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
+
98
124
const terminalPanel = (
99
125
< TerminalPanel
100
126
prev = { prev . terminal }
@@ -111,17 +137,8 @@ function EditorTween({
111
137
southPanel = { southPanel }
112
138
terminalPanel = { terminalPanel }
113
139
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 }
125
142
/>
126
143
)
127
144
}
0 commit comments