Skip to content

Commit

Permalink
feat: missing groupchats hint
Browse files Browse the repository at this point in the history
  • Loading branch information
mvarendorff committed Dec 2, 2023
1 parent 4f4bb38 commit 3ecfabc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 22 deletions.
58 changes: 37 additions & 21 deletions packages/web/src/app/groupchats/components/group-chat-search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import { FC, Fragment, useEffect, useState } from "react";
import { GroupChatPlatform, GroupChatResult } from "ui/groupchats";
import { GroupChatSearchBar } from "ui/groupchats/client";
import { SearchClient } from "typesense";
import { ExclamationTriangleIcon } from "@heroicons/react/20/solid";
import {
ExclamationTriangleIcon,
InformationCircleIcon,
} from "@heroicons/react/20/solid";
import Link from "next/link";
import { navigateToLogin } from "../../../context/user/navigate-to-login";
import { useTypesense } from "../../../context/typesense/provider";
import { useTypesense } from "../../../context/typesense";

type GroupchatResult = {
id: string;
Expand Down Expand Up @@ -66,27 +69,40 @@ export const GroupChatSearch: FC<{ isLoggedIn: boolean }> = ({
/>

<div className={"flex flex-col gap-2"}>
{!isLoggedIn && (
<>
<p>
<ExclamationTriangleIcon
className={"h-6 w-6 text-warning inline-block mr-2"}
/>
Not seeing what you are looking for? Only Facebook groups and
Instagram pages are available without{" "}
<Link
href={"#"}
onClick={navigateToLogin}
className={"underline decoration-brand-500 decoration"}
>
logging in with Discord
</Link>
.
</p>
<p>Not seeing what you are looking for?</p>
<p>
<InformationCircleIcon
className={"h-6 w-6 text-brand-800 inline-block mr-2"}
/>
Ask the group&apos;s admin to shoot me a message{" "}
<a
className={"underline decoration-brand-500"}
href="https://discord.com/users/290193372407136256"
target={"_blank"}
rel="noreferrer"
>
over on Discord
</a>{" "}
to get the group on here!
</p>

<hr />
</>
{!isLoggedIn && (
<p>
<ExclamationTriangleIcon
className={"h-6 w-6 text-warning inline-block mr-2"}
/>
Only Facebook groups and Instagram pages are available without{" "}
<Link
href={"#"}
onClick={navigateToLogin}
className={"underline decoration-brand-500"}
>
logging in with Discord
</Link>
.
</p>
)}
<hr />

{results.map((r) => (
<Fragment key={r.id}>
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/app/groupchats/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Heading } from "ui";
import { GroupChatSearch } from "./components/group-chat-search";
import { Metadata } from "next";
import { getIsLoggedIn } from "../../context/user/user";
import { TypesenseProvider } from "../../context/typesense/provider";
import { TypesenseProvider } from "../../context/typesense";
import { graphqlWithHeaders } from "../../lib/graphql/client";

export const metadata: Metadata = {
Expand Down

0 comments on commit 3ecfabc

Please sign in to comment.