Skip to content

Commit

Permalink
Implement firmware upgrades and system info card
Browse files Browse the repository at this point in the history
  • Loading branch information
sidoh committed Oct 16, 2024
1 parent bbb77b7 commit 53f8f60
Show file tree
Hide file tree
Showing 4 changed files with 379 additions and 54 deletions.
59 changes: 59 additions & 0 deletions web2/components/ui/alert.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "@/lib/utils"

const alertVariants = cva(
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
{
variants: {
variant: {
default: "bg-background text-foreground",
destructive:
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
},
},
defaultVariants: {
variant: "default",
},
}
)

const Alert = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
>(({ className, variant, ...props }, ref) => (
<div
ref={ref}
role="alert"
className={cn(alertVariants({ variant }), className)}
{...props}
/>
))
Alert.displayName = "Alert"

const AlertTitle = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLHeadingElement>
>(({ className, ...props }, ref) => (
<h5
ref={ref}
className={cn("mb-1 font-medium leading-none tracking-tight", className)}
{...props}
/>
))
AlertTitle.displayName = "AlertTitle"

const AlertDescription = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("text-sm [&_p]:leading-relaxed", className)}
{...props}
/>
))
AlertDescription.displayName = "AlertDescription"

export { Alert, AlertTitle, AlertDescription }
50 changes: 19 additions & 31 deletions web2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 7 additions & 11 deletions web2/src/pages/settings/section-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,20 @@ import * as React from "react";
import { useState, useEffect } from "react";
import { NavChildProps } from "@/components/ui/sidebar-pill-nav";
import {
DynamicFormControl,
FieldSection,
FieldSections,
StandardFormField,
FieldSection,
FieldSections
} from "./form-components";
import SelectBox from "@/components/ui/select-box";
import Settings from ".";
import { z } from "zod";
import { schemas } from "@/api";
import { useFormContext } from "react-hook-form";
import {
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
} from "@/components/ui/form";
import Select from "react-select";
import SimpleSelect from "@/components/ui/select-box";

type Settings = z.infer<typeof schemas.Settings>;
Expand Down
Loading

0 comments on commit 53f8f60

Please sign in to comment.