Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat(热门内容): 恢复新热门内容
gaoSireeaaeb5ad163
diff --git a/.idea/workspace.xml b/.idea/workspace.xmlindex 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">{+ "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>+}</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.tsxnew file mode 100644index 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.scssnew file mode 100644index 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 filediff --git a/src/app/[lng]/hotContent/components/HotContentSidebar/index.tsx b/src/app/[lng]/hotContent/components/HotContentSidebar/index.tsxnew file mode 100644index 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.scssnew file mode 100644index 00000000..72c7361a--- /dev/null+++ b/src/app/[lng]/hotContent/hotContent.module.scss@@ -0,0 +1,4 @@+.hotContent {+ :global {+ }+}\ No newline at end of filediff --git a/src/app/[lng]/hotContent/page.tsx b/src/app/[lng]/hotContent/page.tsxnew file mode 100644index 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.tsnew file mode 100644index 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;+ },+ ),+);