Skip to content

Commit c3e584d

Browse files
committed
remove radix themes, centralize css import
1 parent 8b3400d commit c3e584d

File tree

11 files changed

+65
-71
lines changed

11 files changed

+65
-71
lines changed

ui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"@radix-ui/react-toggle": "^1.1.10",
4444
"@radix-ui/react-toggle-group": "^1.1.11",
4545
"@radix-ui/react-tooltip": "^1.2.8",
46-
"@radix-ui/themes": "^3.2.1",
4746
"@stripe/stripe-js": "^8.0.0",
4847
"@tanstack/react-router": "^1.132.47",
4948
"@tanstack/react-router-devtools": "^1.132.51",

ui/src/api/orchestrator_serverFunctions.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,20 @@ export const getRepoDetailsFn = createServerFn({method: 'GET'})
8686
const result = await timeAsync(
8787
`fetchRepoJobs(${repoId})`,
8888
async () => {
89-
const response = await fetch(`${process.env.ORCHESTRATOR_BACKEND_URL}/api/repos/${repoId}/jobs`, {
90-
method: 'GET',
91-
headers: {
92-
'Authorization': `Bearer ${process.env.ORCHESTRATOR_BACKEND_SECRET}`,
93-
'DIGGER_ORG_ID': organisationId,
94-
'DIGGER_USER_ID': userId,
95-
'DIGGER_ORG_SOURCE': 'workos',
96-
},
97-
});
98-
99-
if (!response.ok) {
100-
throw new Error('Failed to fetch jobs');
101-
}
102-
89+
const response = await fetch(`${process.env.ORCHESTRATOR_BACKEND_URL}/api/repos/${repoId}/jobs`, {
90+
method: 'GET',
91+
headers: {
92+
'Authorization': `Bearer ${process.env.ORCHESTRATOR_BACKEND_SECRET}`,
93+
'DIGGER_ORG_ID': organisationId,
94+
'DIGGER_USER_ID': userId,
95+
'DIGGER_ORG_SOURCE': 'workos',
96+
},
97+
});
98+
99+
if (!response.ok) {
100+
throw new Error('Failed to fetch jobs');
101+
}
102+
103103
return await response.json();
104104
}
105105
);

ui/src/api/statesman_serverFunctions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ export const getUnitStatusFn = createServerFn({method: 'GET'})
8080
export const createUnitFn = createServerFn({method: 'POST'})
8181
.inputValidator((data : {userId: string, organisationId: string, email: string, name: string}) => data)
8282
.handler(async ({ data }) => {
83-
const unit : any = await createUnit(data.organisationId, data.userId, data.email, data.name)
83+
const unit : any = await timeAsync(
84+
`createUnit(${data.name})`,
85+
() => createUnit(data.organisationId, data.userId, data.email, data.name)
86+
)
8487
return unit
8588
})
8689

ui/src/authkit/serverFunctions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const getOrganisationDetails = createServerFn({method: 'GET'})
4242
serverCache.setOrg(organizationId, organization);
4343

4444
return organization;
45-
});
45+
});
4646

4747

4848
export const createOrganization = createServerFn({method: 'POST'})

ui/src/components/WorkosOrgSwitcher.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ import { useRouter } from '@tanstack/react-router'
33
import { getWidgetsAuthToken } from '@/authkit/serverFunctions'
44
import { useToast } from '@/hooks/use-toast'
55
import { OrganizationSwitcher, WorkOsWidgets } from '@workos-inc/widgets'
6-
import { DropdownMenu } from '@radix-ui/themes'
7-
8-
import '@workos-inc/widgets/styles.css'
9-
import '@radix-ui/themes/styles.css'
6+
import { DropdownMenuSeparator, DropdownMenuGroup, DropdownMenuItem } from '@/components/ui/dropdown-menu'
107

118
type WorkosOrgSwitcherProps = {
129
userId: string
@@ -84,12 +81,12 @@ export default function WorkosOrgSwitcher({
8481

8582
const extraMenu = showSettingsItem ? (
8683
<>
87-
<DropdownMenu.Separator />
88-
<DropdownMenu.Group>
89-
<DropdownMenu.Item onClick={() => router.navigate({ to: '/dashboard/settings/user' })}>
84+
<DropdownMenuSeparator />
85+
<DropdownMenuGroup>
86+
<DropdownMenuItem onClick={() => router.navigate({ to: '/dashboard/settings/user' })}>
9087
Settings
91-
</DropdownMenu.Item>
92-
</DropdownMenu.Group>
88+
</DropdownMenuItem>
89+
</DropdownMenuGroup>
9390
</>
9491
) : null
9592

ui/src/components/WorkosSettings.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import {
1010
UsersManagement,
1111
} from '@workos-inc/widgets';
1212

13-
import '@workos-inc/widgets/styles.css';
14-
import '@radix-ui/themes/styles.css';
13+
// CSS imports moved to __root.tsx to avoid duplicates
1514
import CreateOrganizationBtn from './CreateOrganisationButtonWOS';
1615
import WorkosOrgSwitcher from './WorkosOrgSwitcher';
1716

ui/src/components/dashboard/JobsTable.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Card } from "@radix-ui/themes"
21
import { Table } from "../ui/table"
32
import { useState } from "react"
4-
import { CardContent, CardHeader, CardTitle, CardDescription } from "../ui/card"
3+
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "../ui/card"
54
import { TableHead, TableRow } from "../ui/table"
65
import { TableHeader, TableBody } from "../ui/table"
76
import { TableCell } from "../ui/table"

ui/src/components/footer.tsx

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
import { Card, Grid, Heading, Text } from '@radix-ui/themes';
1+
import { Card, CardHeader, CardTitle, CardDescription } from '@/components/ui/card';
22

33
export default function Footer() {
44
return (
5-
<Grid columns={{ initial: '1', sm: '3' }} gap={{ initial: '3', sm: '5' }}>
6-
<Card size="4" asChild variant="classic">
7-
<a href="https://workos.com/docs" rel="noreferrer" target="_blank">
8-
<Heading size="4" mb="1">
9-
Documentation
10-
</Heading>
11-
<Text color="gray">View integration guides and SDK documentation.</Text>
12-
</a>
13-
</Card>
14-
<Card size="4" asChild variant="classic">
15-
<a href="https://workos.com/docs/reference" rel="noreferrer" target="_blank">
16-
<Heading size="4" mb="1">
17-
API Reference
18-
</Heading>
19-
<Text color="gray">Every WorkOS API method and endpoint documented.</Text>
20-
</a>
21-
</Card>
22-
<Card size="4" asChild variant="classic">
23-
<a href="https://workos.com" rel="noreferrer" target="_blank">
24-
<Heading size="4" mb="1">
25-
WorkOS
26-
</Heading>
27-
<Text color="gray">Learn more about other WorkOS products.</Text>
28-
</a>
29-
</Card>
30-
</Grid>
5+
<div className="grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-5">
6+
<a href="https://workos.com/docs" rel="noreferrer" target="_blank" className="no-underline">
7+
<Card className="hover:bg-accent transition-colors h-full">
8+
<CardHeader>
9+
<CardTitle className="text-lg mb-1">Documentation</CardTitle>
10+
<CardDescription>View integration guides and SDK documentation.</CardDescription>
11+
</CardHeader>
12+
</Card>
13+
</a>
14+
<a href="https://workos.com/docs/reference" rel="noreferrer" target="_blank" className="no-underline">
15+
<Card className="hover:bg-accent transition-colors h-full">
16+
<CardHeader>
17+
<CardTitle className="text-lg mb-1">API Reference</CardTitle>
18+
<CardDescription>Every WorkOS API method and endpoint documented.</CardDescription>
19+
</CardHeader>
20+
</Card>
21+
</a>
22+
<a href="https://workos.com" rel="noreferrer" target="_blank" className="no-underline">
23+
<Card className="hover:bg-accent transition-colors h-full">
24+
<CardHeader>
25+
<CardTitle className="text-lg mb-1">WorkOS</CardTitle>
26+
<CardDescription>Learn more about other WorkOS products.</CardDescription>
27+
</CardHeader>
28+
</Card>
29+
</a>
30+
</div>
3131
);
3232
}

ui/src/components/sign-in-button.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import { Button, Flex } from '@radix-ui/themes';
1+
import { Button } from '@/components/ui/button';
22
import { Link } from '@tanstack/react-router';
33
import type { User } from '@workos-inc/node';
44

55
export default function SignInButton({ large, user, url }: { large?: boolean; user: User | null; url: string }) {
66
if (user) {
77
return (
8-
<Flex gap="3">
9-
<Button asChild size={large ? '3' : '2'}>
8+
<div className="flex gap-3">
9+
<Button asChild size={large ? 'lg' : 'default'}>
1010
<Link to="/logout">Sign Out</Link>
1111
</Button>
12-
</Flex>
12+
</div>
1313
);
1414
}
1515

1616
return (
17-
<Button asChild size={large ? '3' : '2'} className="cursor-pointer">
17+
<Button asChild size={large ? 'lg' : 'default'} className="cursor-pointer">
1818
<a href={url}>Sign In To Get Started</a>
1919
</Button>
2020
);

ui/src/components/ui/OrgSelector.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import { Card, DropdownMenu, Flex } from "@radix-ui/themes";
1+
// Commented out - legacy file, not currently used
22
// import { getApiProps } from "@repo/env";
33
// import { UsersManagement, WorkOsWidgets } from "@workos-inc/widgets";
44
// import { OrganizationSwitcher } from "@workos-inc/widgets/organization-switcher";
55
// import { WorkOS } from '@workos-inc/node';
66
// import { switchToOrganization } from "@/server-functions/switch-to-organization";
7-
import '@radix-ui/themes/styles.css';
8-
import '@workos-inc/widgets/styles.css';
97

108
// export function getApiProps() {
119
// if (typeof process === "undefined") {
@@ -43,7 +41,7 @@ export default async function OrgSelector(props: { user: any, organizationId: st
4341
// scopes: ["widgets:users-table:manage"],
4442
// });
4543
return (
46-
<Flex gap="2" p="2" direction="column" align="start" width="100%">
44+
<div className="flex gap-2 p-2 flex-col items-start w-full">
4745
{/* <WorkOsWidgets>
4846
<OrganizationSwitcher
4947
authToken={authToken}
@@ -59,6 +57,6 @@ export default async function OrgSelector(props: { user: any, organizationId: st
5957
>
6058
</OrganizationSwitcher>
6159
</WorkOsWidgets> */}
62-
</Flex>
60+
</div>
6361
);
6462
}

0 commit comments

Comments
 (0)