Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

feat: make limit lable editable #83

Merged
merged 1 commit into from
Sep 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/token-input/src/TokenInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {

interface Props {
label?: string
limitLabel?: string
value: string
onChange: (newValue: string) => void
token: keyof typeof tokens | TokenSpec
Expand Down Expand Up @@ -95,7 +96,9 @@ export const TokenInput: React.FunctionComponent<Props> = (props: Props) => {

{props.maxValue && (
<Limit>
<LimitText>Limit: {maxValue}</LimitText>
<LimitText>
{props.limitLabel || 'Limit'}: {maxValue}
</LimitText>
<LimitAction onClick={setMax}>Set max</LimitAction>
</Limit>
)}
Expand Down