Skip to content

chore: use emotion for styling (pt. 6) #10298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
emotion: AgentOutdatedTooltip
  • Loading branch information
aslilac committed Oct 16, 2023
commit d47b551431c4f0e080246eb2089fe2a51e86ce66
23 changes: 10 additions & 13 deletions site/src/components/Resources/AgentOutdatedTooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentProps, FC } from "react";
import { makeStyles } from "@mui/styles";
import { type ComponentProps, type FC } from "react";
import { useTheme } from "@emotion/react";
import RefreshIcon from "@mui/icons-material/RefreshOutlined";
import {
HelpTooltipText,
Expand All @@ -9,7 +9,7 @@ import {
HelpTooltipLinksGroup,
HelpTooltipContext,
} from "components/HelpTooltip/HelpTooltip";
import { WorkspaceAgent } from "api/typesGenerated";
import type { WorkspaceAgent } from "api/typesGenerated";
import { Stack } from "components/Stack/Stack";

type AgentOutdatedTooltipProps = ComponentProps<typeof HelpPopover> & {
Expand All @@ -28,7 +28,11 @@ export const AgentOutdatedTooltip: FC<AgentOutdatedTooltipProps> = ({
onClose,
anchorEl,
}) => {
const styles = useStyles();
const theme = useTheme();
const versionLabelStyles = {
fontWeight: 600,
color: theme.palette.text.primary,
};

return (
<HelpPopover
Expand All @@ -50,12 +54,12 @@ export const AgentOutdatedTooltip: FC<AgentOutdatedTooltipProps> = ({
</div>

<Stack spacing={0.5}>
<span className={styles.versionLabel}>Agent version</span>
<span css={versionLabelStyles}>Agent version</span>
<span>{agent.version}</span>
</Stack>

<Stack spacing={0.5}>
<span className={styles.versionLabel}>Server version</span>
<span css={versionLabelStyles}>Server version</span>
<span>{serverVersion}</span>
</Stack>

Expand All @@ -73,10 +77,3 @@ export const AgentOutdatedTooltip: FC<AgentOutdatedTooltipProps> = ({
</HelpPopover>
);
};

const useStyles = makeStyles((theme) => ({
versionLabel: {
fontWeight: 600,
color: theme.palette.text.primary,
},
}));