Skip to content

Commit

Permalink
fix: help button (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwisecodes authored Sep 12, 2024
1 parent 43403df commit d13a945
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions apps/nextjs/src/app/aila/help/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useRef } from "react";

import { OakLink } from "@oaknational/oak-components";
import { useParams } from "next/navigation";
import { useSearchParams } from "next/navigation";

import { Header } from "@/components/AppComponents/Chat/header";
import GetInTouchBox from "@/components/AppComponents/GetInTouchBox";
Expand All @@ -26,7 +26,8 @@ const Help = () => {
}
};

const ailaId = useParams().ailaId;
const searchParams = useSearchParams();
const ailaId = searchParams.get("ailaId");

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function ChatHistory() {
AI experiments page
</ChatButton>
<ChatButton
href={ailaId ? `aila/help/?ailaId=${ailaId}` : "/aila/help"}
href={ailaId ? `/aila/help/?ailaId=${ailaId}` : "/aila/help"}
variant="text-link"
>
<span className="scale-90">
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/components/AppComponents/Chat/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function Header() {
<div className="flex items-center justify-end space-x-12">
<Link
className="hidden items-center sm:flex"
href={ailaId ? `aila/help/?ailaId=${ailaId}` : "/aila/help"}
href={ailaId ? `/aila/help/?ailaId=${ailaId}` : "/aila/help"}
target="_blank"
>
<OakIcon iconName="question-mark" $width="all-spacing-6" />
Expand Down

0 comments on commit d13a945

Please sign in to comment.