Skip to content

Commit 3b94f6d

Browse files
committed
Move the separator into BrowserConnectionStatus to encapsulate its layout spacing
- in `apps/editor/src/views/prompt/frontend/Main/MainView/components/BrowserConnectionStatus/BrowserConnectionStatus.tsx` show separator(6) when showing the status bar
1 parent 9c74d84 commit 3b94f6d

2 files changed

Lines changed: 29 additions & 27 deletions

File tree

‎apps/editor/src/views/prompt/frontend/Main/MainView/MainView.tsx‎

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -248,19 +248,16 @@ export const MainView: React.FC<Props> = (props) => {
248248
<UiScrollable scroll_to_top_key={props.scroll_reset_key} top_shadow>
249249
<div className={styles.container}>
250250
{props.target == TARGET.WEB && (
251-
<>
252-
<BrowserConnectionStatus
253-
is_connected={props.is_connected}
254-
on_install={props.on_install_browser_extension}
255-
translations={{
256-
connected: t('main.browser-connection.connected'),
257-
not_connected: t('main.browser-connection.not-connected'),
258-
install: t('main.browser-connection.install'),
259-
hide: t('main.browser-connection.hide')
260-
}}
261-
/>
262-
<UiSeparator height={6} />
263-
</>
251+
<BrowserConnectionStatus
252+
is_connected={props.is_connected}
253+
on_install={props.on_install_browser_extension}
254+
translations={{
255+
connected: t('main.browser-connection.connected'),
256+
not_connected: t('main.browser-connection.not-connected'),
257+
install: t('main.browser-connection.install'),
258+
hide: t('main.browser-connection.hide')
259+
}}
260+
/>
264261
)}
265262

266263
{props.response_history.length > 0 && (

‎apps/editor/src/views/prompt/frontend/Main/MainView/components/BrowserConnectionStatus/BrowserConnectionStatus.tsx‎

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useEffect, useState } from 'react'
22
import { StatusBar } from '@ui/components/editor/prompt/StatusBar'
3+
import { Separator } from '@ui/components/editor/prompt/Separator'
34

45
type Props = {
56
is_connected: boolean
@@ -58,19 +59,23 @@ export const BrowserConnectionStatus: React.FC<Props> = (props) => {
5859
}
5960

6061
return (
61-
<StatusBar
62-
theme={props.is_connected ? 'success' : 'default'}
63-
icon={
64-
props.is_connected
65-
? 'codicon-debug-connected'
66-
: 'codicon-debug-disconnect'
67-
}
68-
label={
69-
props.is_connected
70-
? props.translations.connected
71-
: props.translations.not_connected
72-
}
73-
actions={actions}
74-
/>
62+
<>
63+
<StatusBar
64+
theme={props.is_connected ? 'success' : 'default'}
65+
icon={
66+
props.is_connected
67+
? 'codicon-debug-connected'
68+
: 'codicon-debug-disconnect'
69+
}
70+
label={
71+
props.is_connected
72+
? props.translations.connected
73+
: props.translations.not_connected
74+
}
75+
actions={actions}
76+
/>
77+
<Separator height={6} />
78+
</>
7579
)
7680
}
81+

0 commit comments

Comments
 (0)