-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(inputs): ✨ Add Phone number input
- Loading branch information
1 parent
8cba7ff
commit b20bcb1
Showing
19 changed files
with
218 additions
and
10 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
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
46 changes: 46 additions & 0 deletions
46
.../board/graph/BlockNode/StepNode/SettingsPopoverContent/bodies/PhoneNumberSettingsBody.tsx
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,46 @@ | ||
import { FormLabel, Stack } from '@chakra-ui/react' | ||
import { DebouncedInput } from 'components/shared/DebouncedInput' | ||
import { EmailInputOptions } from 'models' | ||
import React from 'react' | ||
|
||
type PhoneNumberSettingsBodyProps = { | ||
options?: EmailInputOptions | ||
onOptionsChange: (options: EmailInputOptions) => void | ||
} | ||
|
||
export const PhoneNumberSettingsBody = ({ | ||
options, | ||
onOptionsChange, | ||
}: PhoneNumberSettingsBodyProps) => { | ||
const handlePlaceholderChange = (placeholder: string) => | ||
onOptionsChange({ ...options, labels: { ...options?.labels, placeholder } }) | ||
const handleButtonLabelChange = (button: string) => | ||
onOptionsChange({ ...options, labels: { ...options?.labels, button } }) | ||
|
||
return ( | ||
<Stack spacing={4}> | ||
<Stack> | ||
<FormLabel mb="0" htmlFor="placeholder"> | ||
Placeholder: | ||
</FormLabel> | ||
<DebouncedInput | ||
id="placeholder" | ||
initialValue={options?.labels?.placeholder ?? 'Your phone number...'} | ||
delay={100} | ||
onChange={handlePlaceholderChange} | ||
/> | ||
</Stack> | ||
<Stack> | ||
<FormLabel mb="0" htmlFor="button"> | ||
Button label: | ||
</FormLabel> | ||
<DebouncedInput | ||
id="button" | ||
initialValue={options?.labels?.button ?? 'Send'} | ||
delay={100} | ||
onChange={handleButtonLabelChange} | ||
/> | ||
</Stack> | ||
</Stack> | ||
) | ||
} |
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
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
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
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 |
---|---|---|
|
@@ -3,5 +3,4 @@ node_modules | |
.env | ||
|
||
dist | ||
types | ||
yarn-error.log |
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
Oops, something went wrong.