Skip to content

Commit

Permalink
fix: minor css linting
Browse files Browse the repository at this point in the history
  • Loading branch information
stefl committed Dec 9, 2024
1 parent b7972ba commit 2af61a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ const ChatRightHandSideLesson = ({

const [showScrollButton, setShowScrollButton] = useState(false);

// This retains this existing bug, but is fixed on subsequent PRs
const sectionRefs = {};

const scrollToBottom = () => {
if (chatEndRef.current) {
setShowScrollButton(false);
Expand All @@ -57,16 +54,13 @@ const ChatRightHandSideLesson = ({

return (
<div
className={`fixed bottom-0 ${showLessonMobile ? "right-0" : "right-[-100%] sm:right-0"} right-0 ${demo.isDemoUser ? "top-8 sm:top-0" : "top-0"} z-30 w-[95%] bg-white shadow-md duration-300 sm:relative sm:z-0 sm:w-[50%] sm:shadow-none lg:w-full`}
className={`fixed bottom-0 ${showLessonMobile ? "right-0" : "right-[-100%] sm:right-0"} right-0 ${demo.isDemoUser ? "top-8 sm:top-0" : "top-0"} z-30 w-[95%] bg-white shadow-md duration-300 sm:relative sm:z-0 sm:w-[50%] sm:shadow-none lg:w-full`}
data-testid="chat-right-hand-side-lesson"
ref={documentContainerRef}
onScroll={handleScroll}
style={{ overflowY: "auto" }}
>
<ExportButtons
sectionRefs={sectionRefs}
documentContainerRef={documentContainerRef}
/>
<ExportButtons documentContainerRef={documentContainerRef} />
<MobileExportButtons
closeMobileLessonPullOut={closeMobileLessonPullOut}
/>
Expand All @@ -87,12 +81,10 @@ const ChatRightHandSideLesson = ({
<LessonPlanDisplay
showLessonMobile={showLessonMobile}
chatEndRef={chatEndRef}
sectionRefs={sectionRefs}
documentContainerRef={documentContainerRef}
/>
</div>
<div
className={`${messages.length > 1 && showLessonMobile ? "flex" : "hidden"} fixed bottom-20 left-0 right-0 items-center justify-center duration-150 sm:hidden`}
className={`${messages.length > 1 && showLessonMobile ? "flex" : "hidden"} fixed bottom-20 left-0 right-0 items-center justify-center duration-150 sm:hidden`}
>
<ChatButton
variant="primary"
Expand All @@ -119,6 +111,7 @@ const ChatRightHandSideLesson = ({
</ChatButton>
</span>
<div ref={endOfDocRef} />
<div className="h-[50vh]"></div>
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,23 @@ import { useDialog } from "../../DialogContext";
import { LessonPlanProgressDropdown } from "./LessonPlanProgressDropdown";

export type ExportButtonsProps = Readonly<{
sectionRefs: Record<string, React.MutableRefObject<HTMLDivElement | null>>;
documentContainerRef: React.MutableRefObject<HTMLDivElement | null>;
}>;

const ExportButtons = ({
sectionRefs,
documentContainerRef,
}: ExportButtonsProps) => {
const ExportButtons = ({ documentContainerRef }: ExportButtonsProps) => {
const chat = useLessonChat();
const { id, isStreaming, lessonPlan } = chat;
const { trackEvent } = useAnalytics();
const { setDialogWindow } = useDialog();
const demo = useDemoUser();

return (
<div className=" sticky left-0 right-10 top-26 z-10 mt-26 hidden bg-white p-14 px-24 shadow-md sm:block">
<div className="sticky left-0 right-10 top-26 z-10 mt-26 hidden bg-white p-14 px-24 shadow-md sm:block">
<div className="flex flex-col">
<div className="flex items-center space-x-14">
<LessonPlanProgressDropdown
lessonPlan={lessonPlan}
isStreaming={isStreaming}
sectionRefs={sectionRefs}
documentContainerRef={documentContainerRef}
/>
<div className="flex space-x-10">
Expand Down

0 comments on commit 2af61a0

Please sign in to comment.