-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
180 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
export enum CRM_PROVIDERS { | ||
ZOHO = 'zoho', | ||
ZENDESK = 'zendesk', | ||
HUBSPOT = 'hubspot', | ||
PIPEDRIVE = 'pipedrive', | ||
FRESHSALES = 'freshsales', | ||
} | ||
|
||
export const providersConfig = { | ||
'CRM': { | ||
'hubspot': { | ||
clientId: 'ba591170-a7c7-4fca-8086-1bd178c6b14d', | ||
scopes: 'crm.objects.contacts.read crm.objects.contacts.write' | ||
}, | ||
// TODO | ||
'zoho': { | ||
clientId: 'Zoho_Client_Id', | ||
scopes: 'Zoho_Scope' | ||
}, | ||
'pipedrive': { | ||
clientId: 'Pipedrive_Client_Id', | ||
scopes: 'Pipedrive_Scope' | ||
}, | ||
'freshsales': { | ||
clientId: 'Pipedrive_Client_Id', | ||
scopes: 'Pipedrive_Scope' | ||
}, | ||
'zendesk': { | ||
clientId: 'Pipedrive_Client_Id', | ||
scopes: 'Pipedrive_Scope' | ||
}, | ||
|
||
} | ||
}; | ||
|
||
export const providerAuthBaseUrls = { | ||
'hubspot': `https://app-eu1.hubspot.com/oauth/authorize`, // TODO: HANDLE EU/US DOMAIN | ||
'zoho': `https://accounts.zoho.com/oauth/v2/auth`, | ||
'pipedrive': `https://oauth.pipedrive.com/oauth/authorize`, | ||
'freshsales': `https://some-freshsales-auth-url`, // Replace with actual URL | ||
'zendesk': `https://some-zendesk-auth-url`, // Replace with actual URL | ||
}; |
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,29 @@ | ||
import React from 'react'; | ||
|
||
type ProviderModalProps = { | ||
isOpen: boolean; | ||
onSelectProvider: (providerName: string) => void; | ||
onClose: () => void; | ||
}; | ||
|
||
const PROVIDERS = ['hubspot', 'zoho', 'pipedrive', 'freshsales', 'zendesk']; | ||
|
||
const ProviderModal: React.FC<ProviderModalProps> = ({ isOpen, onSelectProvider, onClose }) => { | ||
if (!isOpen) return null; | ||
|
||
return ( | ||
<div className="modal"> | ||
<div className="modal-content"> | ||
<h2>Select a CRM Provider</h2> | ||
{PROVIDERS.map(provider => ( | ||
<button key={provider} onClick={() => onSelectProvider(provider)}> | ||
Connect to {provider} | ||
</button> | ||
))} | ||
<button onClick={onClose}>Close</button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ProviderModal; |