Skip to content

Commit 1935c70

Browse files
committed
feat: Added activation guide
1 parent c9ad9cc commit 1935c70

File tree

6 files changed

+24
-3
lines changed

6 files changed

+24
-3
lines changed

CHANGE_LOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
- Added Premium feature to support author's future development
1414
- Added support for Token recharge to unlock more session quotas
15+
- Added activation guide
1516

1617
## v0.6.2
1718

CHANGE_LOG.zh_CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
- 新增 Premium 功能,支持作者后续研发
1414
- 新增支持 Token 充值,解锁更多会话额度
15+
- 新增激活许可证引导
1516

1617
## v0.6.2
1718

src/components/navbar/index.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22

33
import * as React from "react";
44
import { useTranslations } from "next-intl";
5-
import { AiOutlineMenuUnfold, AiOutlineEdit } from "react-icons/ai";
5+
import { AiOutlineMenuUnfold, AiOutlineEdit, AiFillGift } from "react-icons/ai";
66
import { cn } from "@/lib";
7-
import { useChannel, useOpenAI, useMobileMenu, useLLM } from "@/hooks";
7+
import {
8+
useChannel,
9+
useOpenAI,
10+
useMobileMenu,
11+
useLLM,
12+
usePremium,
13+
} from "@/hooks";
814
import Avatar from "@/components/site/avatar";
15+
import { Button } from "@/components/ui";
916
import ConversationSetting from "./conversationSetting";
1017
import Token from "./token";
1118

@@ -16,6 +23,7 @@ export default function Navbar() {
1623
const tSetting = useTranslations("setting");
1724
const [channel] = useChannel();
1825
const { openai, azure } = useLLM();
26+
const [, setPremiumOpen] = usePremium();
1927
const [openAI] = useOpenAI();
2028

2129
const [, setMobileMenuVisible] = useMobileMenu();
@@ -36,6 +44,8 @@ export default function Navbar() {
3644

3745
const onCheckToken = () => tokenRef.current?.init();
3846

47+
const onOpenPremium = () => setPremiumOpen(true);
48+
3949
const activeChannel = channel.list.find(
4050
(item) => item.channel_id === channel.activeId
4151
);
@@ -125,6 +135,12 @@ export default function Navbar() {
125135
)}
126136
</div>
127137

138+
<div className="absolute right-14 hidden md:block">
139+
<Button type="outline" onClick={onOpenPremium}>
140+
<AiFillGift size={20} className="text-orange-400" />
141+
</Button>
142+
</div>
143+
128144
<Avatar />
129145
</div>
130146
<ConversationSetting ref={conversationSettingRef} />

src/components/premium/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ const Premium: React.FC = () => {
265265
onLogin={onLogin}
266266
onPay={onPay}
267267
/>
268-
<div className="mt-2">
268+
<div className="my-2 text-orange-400 text-sm">{t("bought-success")}</div>
269+
<div>
269270
<Link
270271
className="text-sm"
271272
target="_blank"

src/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
"premium": {
9090
"activate": "Activate",
9191
"activate-license": "Activate License",
92+
"bought-success": "Activate the License Key in the settings at the lower left corner of the system after purchase.",
9293
"buy": "Buy",
9394
"buy-for-you": "Buy it for you",
9495
"coming-soon": "Coming soon",

src/locales/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
"premium": {
9090
"activate": "点击激活",
9191
"activate-license": "激活许可证",
92+
"bought-success": "成功购买 许可证 之后前往系统左下角设置按钮处即可进行激活",
9293
"buy": "购买",
9394
"buy-for-you": "点击购买",
9495
"coming-soon": "即将推出",

0 commit comments

Comments
 (0)