Skip to content

chore: use emotion for styling (pt. 3) #10026

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 16 commits into from
Oct 5, 2023
Prev Previous commit
Next Next commit
🧹
  • Loading branch information
aslilac committed Oct 3, 2023
commit ad20b7738fdb7d262f56b8184765817554ee3fe6
7 changes: 3 additions & 4 deletions site/src/components/Resources/ResourceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ export const ResourceCard: FC<ResourceCardProps> = ({ resource, agentRow }) => {
metadataLength += 1;
visibleMetadata.pop();
}
const gridWidth = metadataLength === 1 ? 1 : 4;

return (
<div key={resource.id} className={`${styles.resourceCard} resource-card`}>
<div key={resource.id} css={styles.resourceCard} className="resource-card">
<Stack
direction="row"
alignItems="flex-start"
Expand All @@ -109,9 +110,7 @@ export const ResourceCard: FC<ResourceCardProps> = ({ resource, agentRow }) => {
css={(theme) => ({
flexGrow: 2,
display: "grid",
gridTemplateColumns: `repeat(${
metadataLength === 1 ? 1 : 4
}, minmax(0, 1fr))`,
gridTemplateColumns: `repeat(${gridWidth}, minmax(0, 1fr))`,
gap: theme.spacing(5),
rowGap: theme.spacing(3),
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
}, [templateVersion]);

const hasIcon = template.icon && template.icon !== "";
const templateVersionSucceeded = templateVersion.job.status === "succeeded";
const showBuildLogs = Boolean(buildLogs);
const editorValue = getFileContent(activePath ?? "", fileTree) as string;

Expand Down Expand Up @@ -358,9 +357,8 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
<div css={styles.panelWrapper}>
<div css={styles.tabs}>
<button
css={`
${styles.tab} ${selectedTab === 0 ? "active" : ""}
`}
css={styles.tab}
className={selectedTab === 0 ? "active" : ""}
onClick={() => {
setSelectedTab(0);
}}
Expand All @@ -375,9 +373,8 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({

{!disableUpdate && (
<button
css={`
${styles.tab} ${selectedTab === 1 ? "active" : ""}
`}
css={styles.tab}
className={selectedTab === 0 ? "active" : ""}
onClick={() => {
setSelectedTab(1);
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useMachine } from "@xstate/react";
import { TemplateVersionEditor } from "./TemplateVersionEditor";
import { useOrganizationId } from "hooks/useOrganizationId";
import { usePermissions } from "hooks/usePermissions";
import { FC } from "react";
import { Helmet } from "react-helmet-async";
import { useNavigate, useParams } from "react-router-dom";
Expand All @@ -22,7 +21,6 @@ export const TemplateVersionEditorPage: FC = () => {
const [editorState, sendEvent] = useMachine(templateVersionEditorMachine, {
context: { orgId },
});
const permissions = usePermissions();
const { isSuccess, data } = useTemplateVersionData(
{
orgId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export const templateVersionEditorMachine = createMachine(
},
tsTypes: {} as import("./templateVersionEditorXService.typegen").Typegen0,
initial: "initializing",

states: {
initializing: {
on: {
Expand Down