Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add customizable emailInputPlaceholder #20

Merged
merged 1 commit into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion components/ChatFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import SendIcon from './SendIcon';

const ChatFooter = ({
placeholder,
emailInputPlaceholder,
isSending,
shouldRequireEmail,
onSendMessage,
}: {
placeholder?: string;
emailInputPlaceholder?: string;
isSending: boolean;
shouldRequireEmail?: boolean;
onSendMessage: (message: string, email?: string) => Promise<void>;
Expand Down Expand Up @@ -58,7 +60,7 @@ const ChatFooter = ({
<Box py={1} sx={{borderBottom: '1px solid rgb(230, 230, 230)'}}>
<Input
sx={{variant: 'styles.input.transparent'}}
placeholder="Enter your email"
placeholder={emailInputPlaceholder}
value={email}
onChange={handleEmailChange}
/>
Expand Down
3 changes: 3 additions & 0 deletions components/ChatWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type Props = {
baseUrl?: string;
greeting?: string;
newMessagePlaceholder?: string;
emailInputPlaceholder?: string;
shouldRequireEmail?: boolean;
isMobile?: boolean;
customer?: API.CustomerMetadata;
Expand Down Expand Up @@ -834,6 +835,7 @@ class ChatWindow extends React.Component<Props, State> {
title = 'Welcome!',
subtitle = 'How can we help you?',
newMessagePlaceholder = 'Start typing...',
emailInputPlaceholder = 'Enter your email',
agentAvailableText = "We're online right now!",
agentUnavailableText = "We're away at the moment.",
companyName,
Expand Down Expand Up @@ -969,6 +971,7 @@ class ChatWindow extends React.Component<Props, State> {
<ChatFooter
key={isOpen ? 1 : 0}
placeholder={newMessagePlaceholder}
emailInputPlaceholder={emailInputPlaceholder}
isSending={isSending}
shouldRequireEmail={shouldAskForEmail}
onSendMessage={this.handleSendMessage}
Expand Down
3 changes: 3 additions & 0 deletions components/Widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Config = {
greeting?: string;
customerId?: string;
newMessagePlaceholder?: string;
emailInputPlaceholder?: string;
companyName?: string;
agentAvailableText?: string;
agentUnavailableText?: string;
Expand Down Expand Up @@ -140,6 +141,7 @@ class Wrapper extends React.Component<Props, State> {
title = 'Welcome!',
subtitle = 'How can we help you?',
newMessagePlaceholder = 'Start typing...',
emailInputPlaceholder = 'Enter your email',
primaryColor = '1890ff',
baseUrl = 'https://app.papercups.io',
requireEmailUpfront = '0',
Expand Down Expand Up @@ -167,6 +169,7 @@ class Wrapper extends React.Component<Props, State> {
greeting={greeting}
companyName={companyName}
newMessagePlaceholder={newMessagePlaceholder}
emailInputPlaceholder={emailInputPlaceholder}
agentAvailableText={agentAvailableText}
agentUnavailableText={agentUnavailableText}
showAgentAvailability={shouldHideAvailability}
Expand Down