closes #12
This commit is contained in:
@@ -395,11 +395,17 @@ const ChatPane = ({ showChat, isMinimized, toggleMinimize, closeChat }: ChatPane
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const FloatingChatButton = (): ReactElement => {
|
import { features } from 'config/features';
|
||||||
|
|
||||||
|
const FloatingChatButton = (): ReactElement | null => {
|
||||||
const [showChat, setShowChat] = useState<boolean>(false);
|
const [showChat, setShowChat] = useState<boolean>(false);
|
||||||
// State to control if the chat pane is minimized
|
// State to control if the chat pane is minimized
|
||||||
const [isMinimized, setIsMinimized] = useState<boolean>(false);
|
const [isMinimized, setIsMinimized] = useState<boolean>(false);
|
||||||
|
|
||||||
|
if (!features.enableFloatingChatButton) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// Function to toggle the chat pane visibility
|
// Function to toggle the chat pane visibility
|
||||||
const toggleChat = () => {
|
const toggleChat = () => {
|
||||||
setShowChat(!showChat);
|
setShowChat(!showChat);
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ interface FeatureConfig {
|
|||||||
enableRealEstateAgentRegistration: boolean;
|
enableRealEstateAgentRegistration: boolean;
|
||||||
enableRegistration: boolean;
|
enableRegistration: boolean;
|
||||||
|
|
||||||
|
// UI Features
|
||||||
|
enableFloatingChatButton: boolean;
|
||||||
|
|
||||||
// API Configuration
|
// API Configuration
|
||||||
apiUrl: string;
|
apiUrl: string;
|
||||||
|
|
||||||
@@ -28,6 +31,7 @@ const getFeatureConfig = (): FeatureConfig => {
|
|||||||
enableAttorneyRegistration: false,
|
enableAttorneyRegistration: false,
|
||||||
enableRealEstateAgentRegistration: false,
|
enableRealEstateAgentRegistration: false,
|
||||||
enableRegistration: false,
|
enableRegistration: false,
|
||||||
|
enableFloatingChatButton: false,
|
||||||
apiUrl: 'https://backend.ditchtheagent.com/api/',
|
apiUrl: 'https://backend.ditchtheagent.com/api/',
|
||||||
useLiveData: true,
|
useLiveData: true,
|
||||||
};
|
};
|
||||||
@@ -39,6 +43,7 @@ const getFeatureConfig = (): FeatureConfig => {
|
|||||||
enableAttorneyRegistration: true,
|
enableAttorneyRegistration: true,
|
||||||
enableRealEstateAgentRegistration: true,
|
enableRealEstateAgentRegistration: true,
|
||||||
enableRegistration: true,
|
enableRegistration: true,
|
||||||
|
enableFloatingChatButton: true,
|
||||||
apiUrl: 'https://beta.backend.ditchtheagent.com/api/',
|
apiUrl: 'https://beta.backend.ditchtheagent.com/api/',
|
||||||
useLiveData: true,
|
useLiveData: true,
|
||||||
};
|
};
|
||||||
@@ -49,6 +54,7 @@ const getFeatureConfig = (): FeatureConfig => {
|
|||||||
enableAttorneyRegistration: true,
|
enableAttorneyRegistration: true,
|
||||||
enableRealEstateAgentRegistration: true,
|
enableRealEstateAgentRegistration: true,
|
||||||
enableRegistration: true,
|
enableRegistration: true,
|
||||||
|
enableFloatingChatButton: true,
|
||||||
apiUrl: 'http://127.0.0.1:8010/api/',
|
apiUrl: 'http://127.0.0.1:8010/api/',
|
||||||
useLiveData: false,
|
useLiveData: false,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user