Skip to content

Commit

Permalink
add dashboard sub components
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennievon committed Jul 31, 2024
1 parent 46271a6 commit 5634bd9
Show file tree
Hide file tree
Showing 9 changed files with 410 additions and 302 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { FormField, FormItem, FormControl, FormMessage } from "../../ui/form";
import { Input } from "../../ui/input";

export const AmountInput = ({
form,
walletConnected,
}: {
form: any;
walletConnected: boolean;
}) => {
return (
<FormField
control={form.control}
name="amount"
render={({ field }) => (
<FormItem>
<FormControl>
<Input
type="number"
placeholder="0"
className="text-2xl font-bold w-full dark:bg-[#292929] overflow-ellipsis"
disabled={!walletConnected}
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Chain } from "@/src/types";
import { FormField, FormItem, FormControl, FormMessage } from "../../ui/form";
import {
Select,
SelectTrigger,
SelectContent,
SelectItem,
SelectValue,
} from "../../ui/select";

export const ChainSelect = ({
form,
chains,
name,
}: {
form: any;
chains: Chain[];
name: string;
}) => {
return (
<FormField
control={form.control}
name={name}
render={({ field }) => (
<FormItem>
<Select defaultValue={field.value} onValueChange={field.onChange}>
<FormControl>
<SelectTrigger className="h-8 bg-muted">
<SelectValue placeholder={field.value || "Select Chain"} />
</SelectTrigger>
</FormControl>
<SelectContent>
{chains.map((chain: any) => (
<SelectItem key={chain.value} value={chain.value}>
{chain.name}
</SelectItem>
))}
</SelectContent>
</Select>
<FormMessage />
</FormItem>
)}
/>
);
};
Loading

0 comments on commit 5634bd9

Please sign in to comment.