Skip to content

Commit 3c2ce4f

Browse files
refactor(site): adjust the proxy menu design (#8409)
1 parent ef836de commit 3c2ce4f

File tree

2 files changed

+33
-31
lines changed

2 files changed

+33
-31
lines changed

site/src/components/Navbar/NavbarView.tsx

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ import Skeleton from "@mui/material/Skeleton"
2424
import { BUTTON_SM_HEIGHT } from "theme/theme"
2525
import { ProxyStatusLatency } from "components/ProxyStatusLatency/ProxyStatusLatency"
2626
import { usePermissions } from "hooks/usePermissions"
27-
import {
28-
HelpTooltip,
29-
HelpTooltipText,
30-
HelpTooltipTitle,
31-
} from "components/Tooltips/HelpTooltip"
27+
import Typography from "@mui/material/Typography"
3228

3329
export const USERS_LINK = `/users?filter=${encodeURIComponent("status:active")}`
3430

@@ -191,7 +187,6 @@ export const NavbarView: FC<NavbarViewProps> = ({
191187
const ProxyMenu: FC<{ proxyContextValue: ProxyContextValue }> = ({
192188
proxyContextValue,
193189
}) => {
194-
const styles = useStyles()
195190
const buttonRef = useRef<HTMLButtonElement>(null)
196191
const [isOpen, setIsOpen] = useState(false)
197192
const [refetchDate, setRefetchDate] = useState<Date>()
@@ -275,33 +270,39 @@ const ProxyMenu: FC<{ proxyContextValue: ProxyContextValue }> = ({
275270
onClose={closeMenu}
276271
sx={{ "& .MuiMenu-paper": { py: 1 } }}
277272
>
278-
<MenuItem
279-
sx={[
280-
{ fontSize: 14 },
281-
{ "&:hover": { backgroundColor: "transparent" } },
282-
{ wordWrap: "break-word" },
283-
{ inlineSize: "200px" },
284-
{ whiteSpace: "normal" },
285-
{ textAlign: "center" },
286-
]}
287-
onClick={(e) => {
288-
// Stop the menu from closing
289-
e.stopPropagation()
273+
<Box
274+
sx={{
275+
w: "100%",
276+
fontSize: 14,
277+
padding: 2,
278+
maxWidth: "320px",
279+
lineHeight: "140%",
290280
}}
291281
>
292-
<div>
282+
<Typography
283+
component="h4"
284+
sx={{
285+
fontSize: "inherit",
286+
fontWeight: 600,
287+
lineHeight: "inherit",
288+
margin: 0,
289+
}}
290+
>
293291
Reduce workspace latency by selecting the region nearest you.
294-
{/* This was always on a newline below the text. This puts it on the same line.
295-
It still doesn't look great, but it is marginally better. */}
296-
<HelpTooltip buttonClassName={styles.displayInitial}>
297-
<HelpTooltipTitle>Workspace Proxy Selection</HelpTooltipTitle>
298-
<HelpTooltipText>
299-
Only applies to web connections. Local ssh connections will
300-
automatically select the nearest region based on latency.
301-
</HelpTooltipText>
302-
</HelpTooltip>
303-
</div>
304-
</MenuItem>
292+
</Typography>
293+
<Typography
294+
component="p"
295+
sx={{
296+
fontSize: "inherit",
297+
color: (theme) => theme.palette.text.secondary,
298+
lineHeight: "inherit",
299+
marginTop: 0.5,
300+
}}
301+
>
302+
* Only applies to web connections. Local ssh connections will
303+
automatically select the nearest region based on latency.
304+
</Typography>
305+
</Box>
305306
<Divider sx={{ borderColor: (theme) => theme.palette.divider }} />
306307
{proxyContextValue.proxies?.map((proxy) => (
307308
<MenuItem

site/src/components/ProxyStatusLatency/ProxyStatusLatency.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ export const ProxyStatusLatency: FC<{
1717
return (
1818
<Tooltip title="Loading latency...">
1919
<CircularProgress
20-
size="14px"
20+
size={14}
2121
sx={{
2222
// Always use the no latency color for loading.
2323
color: getLatencyColor(theme, undefined),
24+
marginLeft: "auto",
2425
}}
2526
/>
2627
</Tooltip>

0 commit comments

Comments
 (0)