Skip to content

Let's use AI to Earn!

feat(热门内容): 恢复新热门内容

gaoSireeaaeb5ad163
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ef76d6c2..ad56df0d 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -5,14 +5,12 @@
</component>
<component name="ChangeListManager">
<list default="true" id="8ce961ad-7c9e-494c-bc53-9ecde4358af8" name="更改" comment="feat(数据统计): 添加昨日新增">
- <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/app/[lng]/hot-content/page.css" beforeDir="false" />
- <change beforePath="$PROJECT_DIR$/src/app/[lng]/hot-content/page.tsx" beforeDir="false" />
- <change beforePath="$PROJECT_DIR$/src/app/layout/routerData.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/layout/routerData.ts" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/components/hot-content/HotContent.css" beforeDir="false" />
- <change beforePath="$PROJECT_DIR$/src/components/hot-content/HotContent.tsx" beforeDir="false" />
- <change beforePath="$PROJECT_DIR$/src/components/hot-content/SideMenu.css" beforeDir="false" />
- <change beforePath="$PROJECT_DIR$/src/components/hot-content/SideMenu.tsx" beforeDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/hotContent/HotContentCore.tsx" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/hotContent/components/HotContentSidebar/hotContentSidebar.module.scss" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/hotContent/components/HotContentSidebar/index.tsx" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/hotContent/hotContent.module.scss" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/hotContent/page.tsx" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/hotContent/useHotContent.ts" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -68,48 +66,48 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
- <component name="PropertiesComponent"><![CDATA[{
- "keyToString": {
- "ASKED_ADD_EXTERNAL_FILES": "true",
- "FileHistory.git4idea.history.GitHistoryProvider_flatOrder0": "0",
- "FileHistory.git4idea.history.GitHistoryProvider_flatOrder1": "1",
- "FileHistory.git4idea.history.GitHistoryProvider_flatOrder2": "2",
- "FileHistory.git4idea.history.GitHistoryProvider_flatOrder3": "3",
- "FileHistory.git4idea.history.GitHistoryProvider_flatWidth0": "450",
- "FileHistory.git4idea.history.GitHistoryProvider_flatWidth1": "450",
- "FileHistory.git4idea.history.GitHistoryProvider_flatWidth2": "450",
- "FileHistory.git4idea.history.GitHistoryProvider_flatWidth3": "449",
- "FileHistory.git4idea.history.GitHistoryProvider_treeOrder0": "0",
- "FileHistory.git4idea.history.GitHistoryProvider_treeOrder1": "1",
- "FileHistory.git4idea.history.GitHistoryProvider_treeOrder2": "2",
- "FileHistory.git4idea.history.GitHistoryProvider_treeOrder3": "3",
- "FileHistory.git4idea.history.GitHistoryProvider_treeWidth0": "450",
- "FileHistory.git4idea.history.GitHistoryProvider_treeWidth1": "450",
- "FileHistory.git4idea.history.GitHistoryProvider_treeWidth2": "450",
- "FileHistory.git4idea.history.GitHistoryProvider_treeWidth3": "449",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "RunOnceActivity.cidr.known.project.marker": "true",
- "RunOnceActivity.readMode.enableVisualFormatting": "true",
- "cf.first.check.clang-format": "false",
- "cidr.known.project.marker": "true",
- "dart.analysis.tool.window.visible": "false",
- "git-widget-placeholder": "hot",
- "ignore.virus.scanning.warn.message": "true",
- "kotlin-language-version-configured": "true",
- "last_opened_file_path": "E:/project-dev/web/艺咖/aitoearn-web/src/app/i18n/locales/zh-CN",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.standard": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.standard": "",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "preferences.pluginManager",
- "show.migrate.to.gradle.popup": "false",
- "ts.external.directory.path": "E:\\project-dev\\web\\艺咖\\aitoearn-web\\node_modules\\typescript\\lib",
- "vue.rearranger.settings.migration": "true"
+ <component name="PropertiesComponent">{
+ &quot;keyToString&quot;: {
+ &quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatOrder0&quot;: &quot;0&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatOrder1&quot;: &quot;1&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatOrder2&quot;: &quot;2&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatOrder3&quot;: &quot;3&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatWidth0&quot;: &quot;450&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatWidth1&quot;: &quot;450&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatWidth2&quot;: &quot;450&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatWidth3&quot;: &quot;449&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeOrder0&quot;: &quot;0&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeOrder1&quot;: &quot;1&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeOrder2&quot;: &quot;2&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeOrder3&quot;: &quot;3&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeWidth0&quot;: &quot;450&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeWidth1&quot;: &quot;450&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeWidth2&quot;: &quot;450&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeWidth3&quot;: &quot;449&quot;,
+ &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
+ &quot;RunOnceActivity.cidr.known.project.marker&quot;: &quot;true&quot;,
+ &quot;RunOnceActivity.readMode.enableVisualFormatting&quot;: &quot;true&quot;,
+ &quot;cf.first.check.clang-format&quot;: &quot;false&quot;,
+ &quot;cidr.known.project.marker&quot;: &quot;true&quot;,
+ &quot;dart.analysis.tool.window.visible&quot;: &quot;false&quot;,
+ &quot;git-widget-placeholder&quot;: &quot;hot&quot;,
+ &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
+ &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
+ &quot;last_opened_file_path&quot;: &quot;E:/project-dev/web/艺咖/aitoearn-web/src/app/i18n/locales/zh-CN&quot;,
+ &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
+ &quot;node.js.detected.package.standard&quot;: &quot;true&quot;,
+ &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
+ &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
+ &quot;node.js.selected.package.standard&quot;: &quot;&quot;,
+ &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
+ &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
+ &quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;,
+ &quot;show.migrate.to.gradle.popup&quot;: &quot;false&quot;,
+ &quot;ts.external.directory.path&quot;: &quot;E:\\project-dev\\web\\艺咖\\aitoearn-web\\node_modules\\typescript\\lib&quot;,
+ &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
-}]]></component>
+}</component>
<component name="ReactBuddySettings">
<option name="extensionsIgnore" value="true" />
</component>
diff --git a/src/app/[lng]/hotContent/HotContentCore.tsx b/src/app/[lng]/hotContent/HotContentCore.tsx
new file mode 100644
index 00000000..2bed3c69
--- /dev/null
+++ b/src/app/[lng]/hotContent/HotContentCore.tsx
@@ -0,0 +1,11 @@
+"use client";
+import styles from "./hotContent.module.scss";
+import HotContentSidebar from "@/app/[lng]/hotContent/components/HotContentSidebar";
+
+export const HotContentCore = () => {
+ return (
+ <div className={styles.hotContent}>
+ <HotContentSidebar />
+ </div>
+ );
+};
diff --git a/src/app/[lng]/hotContent/components/HotContentSidebar/hotContentSidebar.module.scss b/src/app/[lng]/hotContent/components/HotContentSidebar/hotContentSidebar.module.scss
new file mode 100644
index 00000000..b69e8022
--- /dev/null
+++ b/src/app/[lng]/hotContent/components/HotContentSidebar/hotContentSidebar.module.scss
@@ -0,0 +1,4 @@
+.hotContentSidebar {
+ :global {
+ }
+}
\ No newline at end of file
diff --git a/src/app/[lng]/hotContent/components/HotContentSidebar/index.tsx b/src/app/[lng]/hotContent/components/HotContentSidebar/index.tsx
new file mode 100644
index 00000000..c66cb5d7
--- /dev/null
+++ b/src/app/[lng]/hotContent/components/HotContentSidebar/index.tsx
@@ -0,0 +1,64 @@
+import { ForwardedRef, forwardRef, memo, useMemo } from "react";
+import styles from "./hotContentSidebar.module.scss";
+import React from "react";
+import Icon from "@ant-design/icons";
+import { Menu } from "antd";
+import type { GetProp, MenuProps } from "antd";
+import HotContentSvg from "../../svgs/hotContent.svg";
+import HotEventSvg from "../../svgs/hotEvent.svg";
+import HotFeaturesSvg from "../../svgs/hotFeatures.svg";
+import HotTitleSvg from "../../svgs/hotTitle.svg";
+
+type MenuItem = GetProp<MenuProps, "items">[number];
+
+export interface IHotContentSidebarRef {}
+
+export interface IHotContentSidebarProps {}
+
+const HotContentSidebar = memo(
+ forwardRef(
+ ({}: IHotContentSidebarProps, ref: ForwardedRef<IHotContentSidebarRef>) => {
+ const items = useMemo(() => {
+ const items: MenuItem[] = [
+ {
+ key: "1",
+ icon: <Icon component={HotContentSvg} />,
+ label: "热门内容",
+ },
+ {
+ key: "2",
+ icon: <Icon component={HotEventSvg} />,
+ label: "热点事件",
+ },
+ {
+ key: "3",
+ icon: <Icon component={HotFeaturesSvg} />,
+ label: "热门专题",
+ },
+ {
+ key: "4",
+ icon: <Icon component={HotTitleSvg} />,
+ label: "爆款标题",
+ },
+ ];
+ return items;
+ }, []);
+
+ console.log(HotContentSvg);
+
+ return (
+ <div className={styles.hotContentSidebar}>
+ <Menu
+ style={{ width: 256 }}
+ defaultSelectedKeys={["1"]}
+ defaultOpenKeys={["sub1"]}
+ items={items}
+ mode="inline"
+ />
+ </div>
+ );
+ },
+ ),
+);
+
+export default HotContentSidebar;
diff --git a/src/app/[lng]/hotContent/hotContent.module.scss b/src/app/[lng]/hotContent/hotContent.module.scss
new file mode 100644
index 00000000..72c7361a
--- /dev/null
+++ b/src/app/[lng]/hotContent/hotContent.module.scss
@@ -0,0 +1,4 @@
+.hotContent {
+ :global {
+ }
+}
\ No newline at end of file
diff --git a/src/app/[lng]/hotContent/page.tsx b/src/app/[lng]/hotContent/page.tsx
new file mode 100644
index 00000000..11b313a9
--- /dev/null
+++ b/src/app/[lng]/hotContent/page.tsx
@@ -0,0 +1,16 @@
+import { PageParams } from "@/app/globals";
+import { getMetadata } from "@/utils/general";
+import { HotContentCore } from "@/app/[lng]/hotContent/HotContentCore";
+
+export async function generateMetadata({ params }: PageParams) {
+ return await getMetadata(
+ {
+ title: "热门内容",
+ },
+ "en",
+ );
+}
+
+export default function Page() {
+ return <HotContentCore />;
+}
diff --git a/src/app/[lng]/hotContent/useHotContent.ts b/src/app/[lng]/hotContent/useHotContent.ts
new file mode 100644
index 00000000..8318e540
--- /dev/null
+++ b/src/app/[lng]/hotContent/useHotContent.ts
@@ -0,0 +1,27 @@
+import { create } from "zustand";
+import { combine } from "zustand/middleware";
+import lodash from "lodash";
+
+export interface IHotContentStore {}
+
+const store: IHotContentStore = {};
+
+const getStore = () => {
+ return lodash.cloneDeep(store);
+};
+
+/**
+ * 热门内容数据存储
+ */
+export const useHotContent = create(
+ combine(
+ {
+ ...getStore(),
+ },
+ (set, get, storeApi) => {
+ const methods = {};
+
+ return methods;
+ },
+ ),
+);