mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-09 00:30:40 +02:00
Lock body scroll when mobile is active
This commit is contained in:
@@ -56,6 +56,7 @@ import {
|
||||
import { ChatPersona } from '../UserPersona/ChatPersona';
|
||||
import { userPersonaOptions } from '../../queries/user-persona';
|
||||
import { UpdatePersonaModal } from '../UserPersona/UpdatePersonaModal';
|
||||
import { lockBodyScroll } from '../../lib/dom';
|
||||
|
||||
export type RoamdapAIChatHistoryType = {
|
||||
role: AllowedAIChatRole;
|
||||
@@ -135,6 +136,10 @@ export function RoadmapAIChat(props: RoadmapAIChatProps) {
|
||||
queryClient,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
lockBodyScroll(isChatMobileVisible);
|
||||
}, [isChatMobileVisible]);
|
||||
|
||||
const isLimitExceeded = (tokenUsage?.used || 0) >= (tokenUsage?.limit || 0);
|
||||
const isPaidUser = userBillingDetails?.status === 'active';
|
||||
|
||||
|
@@ -371,7 +371,9 @@ export function TopicDetail(props: TopicDetailProps) {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (isActive) topicRef?.current?.focus();
|
||||
if (isActive) {
|
||||
topicRef?.current?.focus();
|
||||
}
|
||||
|
||||
lockBodyScroll(isActive);
|
||||
}, [isActive]);
|
||||
|
Reference in New Issue
Block a user