Skip to content

Commit

Permalink
fix: replaced label component with input props
Browse files Browse the repository at this point in the history
  • Loading branch information
baktun14 committed Jul 31, 2024
1 parent 5e1223b commit 2975bc8
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ const formSchema = z
.object({
amount: z.coerce
.number({
required_error: "Amount is required",
invalid_type_error: "Amount must be a number"
invalid_type_error: "Amount must be a number."
})
.min(0.000001, { message: "Amount must be greater than 0" }),
.min(0.000001, { message: "Amount is required." }),
useDepositor: z.boolean().optional(),
depositorAddress: z.string().optional()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
CheckboxWithLabel,
CustomPagination,
Input,
Label,
Spinner,
Table,
TableBody,
Expand Down Expand Up @@ -184,10 +183,10 @@ export const DeploymentList: React.FunctionComponent = () => {
{((filteredDeployments?.length || 0) > 0 || !!search) && (
<div className="flex items-center pb-4 pt-2">
<div className="flex-grow">
<Label>Search Deployments by name</Label>
<Input
value={search}
onChange={onSearchChange}
label="Search Deployments by name"
className="w-full"
type="text"
endIcon={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
DropdownMenuContent,
DropdownMenuTrigger,
Input,
Label,
Snackbar,
Spinner
} from "@akashnetwork/ui/components";
Expand Down Expand Up @@ -219,14 +218,14 @@ export const CreateLease: React.FunctionComponent<Props> = ({ dseq }) => {
<div className="flex flex-col items-end justify-between py-2 md:flex-row">
<div className="flex w-full flex-grow items-end md:w-auto">
<div className="flex-grow">
<Label>Search provider</Label>
<Input
placeholder="Search provider..."
disabled={bids?.length === 0 || isSendingManifest}
value={search}
onChange={onSearchChange}
type="text"
className="w-full"
label="Search provider"
endIcon={
search && (
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export const ManifestEdit: React.FunctionComponent<Props> = ({ editedManifest, s
<div className="flex-grow">
<Button
variant="default"
// disabled={isCreatingDeployment || !!parsingError || !editedManifest}
disabled={isCreatingDeployment || !!parsingError || !editedManifest}
onClick={() => handleCreateDeployment()}
className="w-full whitespace-nowrap sm:w-auto"
data-testid="create-deployment-btn"
Expand Down
3 changes: 1 addition & 2 deletions apps/deploy-web/src/components/new-deployment/SdlBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const SdlBuilder = React.forwardRef<SdlBuilderRefType, Props>(({ sdlStrin
},
resolver: zodResolver(SdlBuilderFormValuesSchema)
});
const { control, trigger, watch, setValue, formState } = form;
const { control, trigger, watch, setValue } = form;
const {
fields: services,
remove: removeService,
Expand All @@ -51,7 +51,6 @@ export const SdlBuilder = React.forwardRef<SdlBuilderRefType, Props>(({ sdlStrin
const { services: _services = [] } = watch();
const { data: gpuModels } = useGpuModels();
const [serviceCollapsed, setServiceCollapsed] = useState([]);
console.log(formState.errors);

React.useImperativeHandle(ref, () => ({
getSdl: getSdl,
Expand Down
2 changes: 1 addition & 1 deletion apps/deploy-web/src/components/providers/ProviderList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ export const ProviderList: React.FunctionComponent = () => {

<div className="my-2 flex flex-col items-center space-y-2 md:flex-row md:space-x-2 md:space-y-0">
<div className="flex-grow">
<Label>Search Providers</Label>
<Input
value={search}
onChange={onSearchChange}
className="w-full"
label="Search Providers"
type="text"
endIcon={
!!search && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import { ReactNode, useEffect, useState } from "react";
import { Input, Label, Popup, Snackbar } from "@akashnetwork/ui/components";
import { Input, Popup, Snackbar } from "@akashnetwork/ui/components";
import { Bin, Check } from "iconoir-react";
import { event } from "nextjs-google-analytics";
import { useSnackbar } from "notistack";
Expand Down Expand Up @@ -107,9 +107,9 @@ export const EditAddressBookmarkModal: React.FunctionComponent<Props> = ({ open,
>
<FormPaper contentClassName="flex items-center p-4 flex-col space-y-2">
<div className="w-full">
<Label>Address</Label>
<Input
placeholder="Address"
label="Address"
value={_address}
onChange={ev => setAddress(ev.target.value)}
// Disabled if saving, deleting or if there is an address
Expand All @@ -119,9 +119,9 @@ export const EditAddressBookmarkModal: React.FunctionComponent<Props> = ({ open,
</div>

<div className="w-full">
<Label>Custom name</Label>
<Input
placeholder="Your custom name"
label="Custom name"
value={customName}
onChange={ev => setCustomName(ev.target.value)}
disabled={isSaving || isDeleting}
Expand Down

0 comments on commit 2975bc8

Please sign in to comment.