mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
fix: center proxy spinner (#16621)
Fixes: https://github.com/coder/coder/issues/16615
This commit is contained in:
@@ -10,9 +10,14 @@ import { getLatencyColor } from "utils/latency";
|
||||
interface LatencyProps {
|
||||
latency?: number;
|
||||
isLoading?: boolean;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
export const Latency: FC<LatencyProps> = ({ latency, isLoading }) => {
|
||||
export const Latency: FC<LatencyProps> = ({
|
||||
latency,
|
||||
isLoading,
|
||||
size = 14,
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
// Always use the no latency color for loading.
|
||||
const color = getLatencyColor(theme, isLoading ? undefined : latency);
|
||||
@@ -21,7 +26,7 @@ export const Latency: FC<LatencyProps> = ({ latency, isLoading }) => {
|
||||
return (
|
||||
<Tooltip title="Loading latency...">
|
||||
<CircularProgress
|
||||
size={14}
|
||||
size={size}
|
||||
css={{ marginLeft: "auto" }}
|
||||
style={{ color }}
|
||||
/>
|
||||
|
||||
@@ -99,6 +99,7 @@ export const ProxyMenu: FC<ProxyMenuProps> = ({ proxyContextValue }) => {
|
||||
<Latency
|
||||
latency={latencies?.[selectedProxy.id]?.latencyMS}
|
||||
isLoading={proxyLatencyLoading(selectedProxy)}
|
||||
size={24}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user