-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explore Endpoints: pages part 1 (#805)
* All Assets * Claimable Balances * Effects + refactor endpoint URL template * Fee Stats * Ledgers * Offers * Operations * Fix positiveInt validation when changing routes
- Loading branch information
Showing
9 changed files
with
607 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from "react"; | ||
import { Input, InputProps } from "@stellar/design-system"; | ||
|
||
interface PositiveIntPickerProps extends Omit<InputProps, "fieldSize"> { | ||
id: string; | ||
fieldSize?: "sm" | "md" | "lg"; | ||
labelSuffix?: string | React.ReactNode; | ||
label: string; | ||
value: string; | ||
placeholder?: string; | ||
error: string | undefined; | ||
// eslint-disable-next-line no-unused-vars | ||
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void; | ||
} | ||
|
||
export const PositiveIntPicker = ({ | ||
id, | ||
fieldSize = "md", | ||
labelSuffix, | ||
label, | ||
value, | ||
error, | ||
onChange, | ||
...props | ||
}: PositiveIntPickerProps) => { | ||
return ( | ||
<Input | ||
id={id} | ||
fieldSize={fieldSize} | ||
label={label} | ||
labelSuffix={labelSuffix} | ||
value={value} | ||
error={error} | ||
onChange={onChange} | ||
{...props} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from "react"; | ||
import { Input, InputProps } from "@stellar/design-system"; | ||
|
||
interface TextPickerProps extends Omit<InputProps, "fieldSize"> { | ||
id: string; | ||
fieldSize?: "sm" | "md" | "lg"; | ||
labelSuffix?: string | React.ReactNode; | ||
label: string; | ||
value: string; | ||
placeholder?: string; | ||
error: string | undefined; | ||
// eslint-disable-next-line no-unused-vars | ||
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void; | ||
} | ||
|
||
export const TextPicker = ({ | ||
id, | ||
fieldSize = "md", | ||
labelSuffix, | ||
label, | ||
value, | ||
error, | ||
onChange, | ||
...props | ||
}: TextPickerProps) => { | ||
return ( | ||
<Input | ||
id={id} | ||
fieldSize={fieldSize} | ||
label={label} | ||
labelSuffix={labelSuffix} | ||
value={value} | ||
error={error} | ||
onChange={onChange} | ||
{...props} | ||
/> | ||
); | ||
}; |
Oops, something went wrong.