Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwisecodes committed Aug 29, 2024
1 parent b4d4eb2 commit 555fb9f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function basedOnTitle(basedOn: string | BasedOnOptional) {
}

const displayStyles = cva(
"relative flex flex-col space-y-10 px-14 pb-28 opacity-100 sm:px-24 sm:pt-29",
"relative flex flex-col space-y-10 px-14 pb-28 opacity-100 sm:px-24 ",
);

const organiseSections = [
Expand Down
4 changes: 4 additions & 0 deletions apps/nextjs/src/components/AppComponents/Chat/chat-start.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import useAnalytics from "@/lib/analytics/useAnalytics";
import { trpc } from "@/utils/trpc";

import { useDialog } from "../DialogContext";
import BetaTag from "./beta-tag";
import ChatPanelDisclaimer from "./chat-panel-disclaimer";
import { ChatStartForm } from "./chat-start-form";
import EmptyScreenAccordion from "./empty-screen-accordian";
Expand Down Expand Up @@ -101,6 +102,9 @@ export function ChatStart() {
<div className="mx-auto flex h-full max-w-[580px] flex-col justify-between">
<div className="flex h-full flex-col justify-center gap-18">
<div>
<div className="mb-13 block w-fit sm:hidden">
<BetaTag />
</div>
<h1
data-testid="chat-h1"
className="mb-11 text-3xl font-semibold capitalize"
Expand Down
27 changes: 19 additions & 8 deletions apps/nextjs/src/components/AppComponents/Chat/desktop-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ import { useDemoLocking } from "hooks/useDemoLocking";
import { useMobileLessonPullOutControl } from "hooks/useMobileLessonPullOutControl";

import AiIcon from "@/components/AiIcon";
import Button from "@/components/Button";
import { useLessonChat } from "@/components/ContextProviders/ChatProvider";
import { useDemoUser } from "@/components/ContextProviders/Demo";
import { cn } from "@/lib/utils";

import { useDialog } from "../DialogContext";
import LessonPlanDisplay from "./chat-lessonPlanDisplay";
import { ChatList } from "./chat-list";
import { ChatPanel } from "./chat-panel";
import { ChatPanelArea } from "./chat-panel-area";
import QuickActionButtons from "./chat-quick-buttons";
import ExportButtons from "./export-buttons";
import { LessonPlanProgressBar } from "./export-buttons/LessonPlanProgressBar";
import { LessonPlanProgressDropdown } from "./export-buttons/LessonPlanProgressDropdown";
import ChatButton from "./ui/chat-button";

export interface DesktopChatLayoutProps {
Expand Down Expand Up @@ -51,7 +50,7 @@ export const DesktopChatLayout = ({
ailaStreamingStatus,
messages,
});

const { setDialogWindow } = useDialog();
const scrollToBottom = () => {
if (chatEndRef.current) {
setShowScrollButton(false);
Expand Down Expand Up @@ -110,7 +109,7 @@ export const DesktopChatLayout = ({
New lesson
</ChatButton>
</div>
<div className="mt-6 flex justify-end">
<div className="mt-6 flex justify-end sm:hidden">
<button
onClick={() => setShowLessonMobile(!showLessonMobile)}
className="flex items-center gap-5"
Expand Down Expand Up @@ -138,18 +137,18 @@ export const DesktopChatLayout = ({
</Flex>

<div
className={`fixed bottom-0 ${showLessonMobile ? `right-0` : `right-[-100%]`} right-0 top-0 z-30 w-[95%] bg-white duration-300 sm:relative sm:z-0 sm:w-[50%] lg:w-full`}
className={`fixed bottom-0 ${showLessonMobile ? `right-0` : `right-[-100%] sm:right-0`} right-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`}
ref={documentContainerRef}
onScroll={handleScroll}
style={{ overflowY: "auto" }}
>
<div className="hidden sm:block">
<div className="mt-26 hidden sm:block">
<ExportButtons
sectionRefs={sectionRefs}
documentContainerRef={documentContainerRef}
/>
</div>
<div className="ml-[-10px] mt-30 flex px-14 sm:hidden">
<div className="ml-[-10px] mt-30 flex justify-between px-14 sm:hidden">
<button
onClick={() => {
setShowLessonMobile(false);
Expand All @@ -162,8 +161,20 @@ export const DesktopChatLayout = ({
</span>
<span className="text-base font-bold">Hide lesson</span>
</button>
<button
className="scale-75"
onClick={() => {
if (demo.isSharingEnabled) {
setDialogWindow("share-chat");
} else {
setDialogWindow("demo-share-locked");
}
}}
>
<OakIcon iconName="share" />
</button>
</div>
<div className="px-14 pb-9 pt-12">
<div className="block px-14 pb-9 pt-12 sm:hidden">
<LessonPlanProgressBar lessonPlan={lessonPlan} />
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import React, { useState, useMemo } from "react";
import React, { useMemo } from "react";

import { LooseLessonPlan } from "@oakai/aila/src/protocol/schema";
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
import { Flex } from "@radix-ui/themes";

import { Icon } from "@/components/Icon";
import { scrollToRef } from "@/utils/scrollToRef";

export const LESSON_PLAN_SECTIONS = [
{ key: "title", title: "Title" },
Expand Down
9 changes: 4 additions & 5 deletions apps/nextjs/src/components/AppComponents/Chat/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Link from "next/link";

import { useDemoUser } from "@/components/ContextProviders/Demo";
import { Icon } from "@/components/Icon";
import { Logo } from "@/components/Logo";
import OakIconLogo from "@/components/OakIconLogo";

import BetaTag from "./beta-tag";
Expand Down Expand Up @@ -56,11 +55,11 @@ export function Header() {
<span className="hidden font-bold sm:block">
AI lesson assistant
</span>
<span className="flex items-center justify-center gap-8 sm:hidden">
<span className="flex items-center justify-center gap-9 sm:hidden">
<Link href="/" aria-label="go to home page">
<OakIconLogo />
</Link>
<span className="font-bold">Aila</span>
<span className="text-xl font-bold">Aila</span>
</span>
<div className="hidden sm:flex">
<BetaTag />
Expand All @@ -79,9 +78,9 @@ export function Header() {
</div>
<div className="flex items-center justify-end space-x-12">
<div className="flex sm:hidden">
<button>
<Link href="/aila/help">
<OakIcon iconName="question-mark" />
</button>
</Link>
</div>
<div className="= flex items-center">
<UserOrLogin />
Expand Down

0 comments on commit 555fb9f

Please sign in to comment.