Skip to content

Commit

Permalink
add contact button
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Oct 25, 2023
1 parent 8f600d5 commit c266821
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 13 deletions.
Binary file added app/public/source/qq.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions app/src/assets/home.less
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,10 @@
flex-shrink: 0;
}
}

.contact-image {
margin-top: 0.75rem;
max-width: min(60vw, 420px);
max-height: 80vh;
border-radius: var(--radius);
}
50 changes: 41 additions & 9 deletions app/src/components/home/ChatWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { formatMessage } from "../../utils.ts";
import ChatInterface from "./ChatInterface.tsx";
import { Button } from "../ui/button.tsx";
import router from "../../router.tsx";
import { BookMarked, ChevronRight, FolderKanban, Globe } from "lucide-react";
import {BookMarked, ChevronRight, FolderKanban, Globe, Users2} from "lucide-react";
import {
Tooltip,
TooltipContent,
Expand All @@ -25,6 +25,15 @@ import { Toggle } from "../ui/toggle.tsx";
import { Input } from "../ui/input.tsx";
import EditorProvider from "../EditorProvider.tsx";
import ModelSelector from "./ModelSelector.tsx";
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger
} from "../ui/dialog.tsx";

function ChatWrapper() {
const { t } = useTranslation();
Expand Down Expand Up @@ -90,14 +99,37 @@ function ChatWrapper() {
<ChatInterface />
) : (
<div className={`chat-product`}>
<Button
variant={`outline`}
onClick={() => window.open("https://docs.chatnio.net", "_blank")}
>
<BookMarked className={`h-4 w-4 mr-1.5`} />
{t("docs.title")}
<ChevronRight className={`h-4 w-4 ml-2`} />
</Button>
<Dialog>
<DialogTrigger asChild>
<Button variant={`outline`}>
<Users2 className={`h-4 w-4 mr-1.5`} />
{t("contact.title")}
<ChevronRight className={`h-4 w-4 ml-2`} />
</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>{t("contact.title")}</DialogTitle>
<DialogDescription />
<Button
className={`mx-auto`}
variant={`outline`}
onClick={() => window.open("https://docs.chatnio.net", "_blank")}
>
<BookMarked className={`h-4 w-4 mr-1.5`} />
{t("docs.title")}
</Button>
<a
href={"http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=1oKfIbNVXmMNMVzW1NiFSTKDcT1qIEq5&authKey=uslxslIBZtLImf4BSxjDqfx4hiJA52YV7PFM38W%2BOArr%2BhE0jwVdQCRYs0%2FXKX7W&noverify=0&group_code=565902327"}
target={"_blank"}
className={`mx-auto`}
>
<img src={`/source/qq.jpg`} className={`contact-image`} alt={`QQ`} />
</a>

</DialogHeader>
</DialogContent>
</Dialog>
<Button
variant={`outline`}
onClick={() => router.navigate("/generate")}
Expand Down
16 changes: 13 additions & 3 deletions app/src/dialogs/ShareManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,19 @@ function ShareManagement() {
<DialogContent>
<DialogHeader>
<DialogTitle>{t("share.manage")}</DialogTitle>
<DialogDescription className={`share-table`}>
<ShareTable data={data} />
</DialogDescription>
{
data.length > 0 ? (
<DialogDescription className={`share-table`}>
<ShareTable data={data} />
</DialogDescription>
) : (
<DialogDescription>
<p className={`text-center select-none mt-6 mb-2`}>
{t("conversation.empty")}
</p>
</DialogDescription>
)
}
</DialogHeader>
<DialogFooter>
<Button variant={`outline`} onClick={() => dispatch(closeDialog())}>
Expand Down
12 changes: 11 additions & 1 deletion app/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ const resources = {
"check-success": "Redeem Success",
"check-success-description": "Redeem Success! You have received {{amount}} points, start your AI journey!",
"check-failed": "Redeem Failed",
},
contact: {
title: "Contact Us",
}
},
},
Expand Down Expand Up @@ -399,7 +402,11 @@ const resources = {
"check-success": "兑换成功",
"check-success-description": "兑换成功!您已获得 {{amount}} 点数,开始您的 AI 之旅吧!",
"check-failed": "兑换失败",
}
},
contact: {
title: "联系我们",
},

},
},
ru: {
Expand Down Expand Up @@ -603,6 +610,9 @@ const resources = {
"check-success": "Успешно",
"check-success-description": "Успешно! Вы получили {{amount}} очков, начните свое путешествие в мир AI!",
"check-failed": "Не удалось",
},
contact: {
title: "Связаться с нами",
}
},
},
Expand Down

0 comments on commit c266821

Please sign in to comment.