Skip to content

Commit 0e0d0d0

Browse files
committed
Update export-to-language to LG Code v18
1 parent 80a9de6 commit 0e0d0d0

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

packages/compass-components/src/components/leafygreen.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { default as Badge } from '@leafygreen-ui/badge';
88
import { default as Banner } from '@leafygreen-ui/banner';
99
import Checkbox from '@leafygreen-ui/checkbox';
1010
import Card from '@leafygreen-ui/card';
11-
import Code, { Language } from '@leafygreen-ui/code';
11+
import Code, { Language, Panel } from '@leafygreen-ui/code';
1212
import ConfirmationModal from '@leafygreen-ui/confirmation-modal';
1313
import { default as LeafyGreenIcon } from '@leafygreen-ui/icon';
1414
import type { Size as LeafyGreenIconSize } from '@leafygreen-ui/icon';
@@ -128,6 +128,7 @@ export {
128128
Checkbox,
129129
Chip,
130130
Code,
131+
Panel,
131132
ConfirmationModal,
132133
Copyable,
133134
ExpandedContent,

packages/compass-export-to-language/src/components/modal.tsx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
css,
66
Label,
77
Code,
8+
Panel,
89
Checkbox,
910
Banner,
1011
spacing,
@@ -240,13 +241,16 @@ const ExportToLanguageModal: React.FunctionComponent<
240241
className={codeStyles}
241242
id="export-to-language-input"
242243
data-testid="export-to-language-input"
243-
languageOptions={shellLanguageOptions}
244-
onChange={() => {
245-
// There is only one language option and we don't allow to change
246-
// the value
247-
}}
248244
language="Shell"
249-
copyable={true}
245+
panel={
246+
<Panel
247+
languageOptions={shellLanguageOptions}
248+
onChange={() => {
249+
// There is only one language option and we don't allow to change
250+
// the value
251+
}}
252+
/>
253+
}
250254
>
251255
{prettyInput}
252256
</Code>
@@ -266,13 +270,18 @@ const ExportToLanguageModal: React.FunctionComponent<
266270
className={codeStyles}
267271
id="export-to-language-output"
268272
data-testid="export-to-language-output"
269-
languageOptions={languageOptions}
270-
onChange={(option: LanguageOption) =>
271-
setOutputLanguage(codeLanguageToOutputLanguage(option.language))
272-
}
273273
language={outputLanguageToCodeLanguage(outputLanguage)}
274-
copyable={true}
275-
onCopy={trackCopiedOutput}
274+
panel={
275+
<Panel
276+
languageOptions={shellLanguageOptions}
277+
onCopy={trackCopiedOutput}
278+
onChange={(option: LanguageOption) =>
279+
setOutputLanguage(
280+
codeLanguageToOutputLanguage(option.language)
281+
)
282+
}
283+
/>
284+
}
276285
>
277286
{transpiledExpression || ''}
278287
</Code>

0 commit comments

Comments
 (0)