Skip to content

Commit

Permalink
Merge pull request #252 from pascalbreuninger/main
Browse files Browse the repository at this point in the history
feat(ui): add civo and terraform as recommended providers
  • Loading branch information
pascalbreuninger authored May 15, 2023
2 parents 6ee61d0 + 1afd630 commit 162016f
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 17 deletions.
2 changes: 1 addition & 1 deletion desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "devpod",
"private": true,
"version": "0.0.4",
"version": "0.0.5",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion desktop/src/client/workspaces/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { invoke } from "@tauri-apps/api"
import { TActionID, TActionName, TActionObj } from "../../contexts"
import { exists, noop, Result, ResultError, Return, THandler } from "../../lib"
import { Result, ResultError, Return, THandler, exists, noop } from "../../lib"
import {
TStreamID,
TUnsubscribeFn,
Expand Down
4 changes: 2 additions & 2 deletions desktop/src/components/ExampleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ type TExampleCardProps = {

const sizes: Record<"sm" | "md" | "lg", BoxProps["width"]> = {
sm: "12",
md: "20",
lg: "24",
md: "16",
lg: "20",
} as const

export function ExampleCard({
Expand Down
4 changes: 4 additions & 0 deletions desktop/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { BoxProps } from "@chakra-ui/react"
import {
AWSSvg,
AzureSvg,
CivoSvg,
DigitalOceanSvg,
DockerSvg,
GCloudSvg,
KubernetesSvg,
SSHSvg,
TerraformSvg,
} from "./images"

export const STATUS_BAR_HEIGHT: NonNullable<BoxProps["height"]> = "8"
Expand All @@ -21,4 +23,6 @@ export const RECOMMENDED_PROVIDER_SOURCES = [
{ image: GCloudSvg, name: "gcloud", group: "cloud" },
{ image: AzureSvg, name: "azure", group: "cloud" },
{ image: DigitalOceanSvg, name: "digitalocean", group: "cloud" },
{ image: CivoSvg, name: "civo", group: "cloud" },
{ image: TerraformSvg, name: "terraform", group: "cloud" },
] as const
5 changes: 5 additions & 0 deletions desktop/src/images/civo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions desktop/src/images/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ export { default as GCloudSvg } from "./gcp.svg"
export { default as AWSSvg } from "./aws.svg"
export { default as DigitalOceanSvg } from "./digitalocean.svg"
export { default as AzureSvg } from "./azure.svg"
export { default as CivoSvg } from "./civo.svg"
export { default as TerraformSvg } from "./terraform.svg"
6 changes: 6 additions & 0 deletions desktop/src/images/terraform.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 20 additions & 13 deletions desktop/src/views/Workspaces/CreateWorkspace/CreateWorkspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,11 @@ type TProviderInputProps = Readonly<{
onRecommendedProviderClicked: (provider: TProviderID) => void
}>
function ProviderInput({ options, field, onRecommendedProviderClicked }: TProviderInputProps) {
const gridChildWidth = useToken("sizes", "12")

return (
<Grid
templateRows={{
lg: "repeat(2, 1fr)",
xl: options.installed.length <= 2 ? "1fr" : "repeat(2, 1fr)",
}}
gridAutoFlow={"column"}>
<HStack>
<Grid>
<HStack height="fit-content">
{options.installed.map((p) => (
<Box key={p.name}>
<ExampleCard
Expand All @@ -427,15 +424,24 @@ function ProviderInput({ options, field, onRecommendedProviderClicked }: TProvid
</Box>
))}
</HStack>
<HStack position={"relative"} top={"-10px"} marginTop={"20px"}>
<Grid
gap={2}
height="fit-content"
templateRows={{ base: "repeat(2, 1fr)", xl: "1fr" }}
templateColumns={{
base: `repeat(6, ${gridChildWidth})`,
xl: `repeat(10, ${gridChildWidth})`,
}}
position={"relative"}
marginTop={"8"}>
<Text
position={"absolute"}
left={"5px"}
position="absolute"
left="0"
top={"-18px"}
textAlign="center"
fontSize="sm"
color="gray.500">
{"Recommended Providers"}
Recommended Providers
</Text>
{options.recommended.map((p) => (
<Box key={p.name} filter="grayscale(100%)" _hover={{ filter: "grayscale(0%)" }}>
Expand All @@ -447,7 +453,7 @@ function ProviderInput({ options, field, onRecommendedProviderClicked }: TProvid
/>
</Box>
))}
</HStack>
</Grid>
</Grid>
)
}
Expand All @@ -464,8 +470,9 @@ function IDEInput({ ides, field, onClick }: TIDEInputProps) {

return (
<Grid
gap={2}
gridTemplateColumns={{
lg: `repeat(8, ${gridChildWidth})`,
lg: `repeat(6, ${gridChildWidth})`,
xl: `repeat(11, ${gridChildWidth})`,
"2xl": `repeat(auto-fit, ${gridChildWidth})`,
}}>
Expand Down

0 comments on commit 162016f

Please sign in to comment.