diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d8c4146
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 ourongxing
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/package.json b/package.json
index 2925222..6fd4072 100644
--- a/package.json
+++ b/package.json
@@ -4,6 +4,12 @@
"version": "0.0.1",
"private": true,
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b",
+ "author": {
+ "url": "https://github.com/ourongxing/",
+ "email": "orongxing@gmail.com",
+ "name": "Ou Rongxing"
+ },
+ "homepage": "https://github.com/ourongxing/newsnow",
"scripts": {
"dev": "vite dev",
"build": "vite build",
diff --git a/shared/consts.ts b/shared/consts.ts
index ff3cf06..9c7de3f 100644
--- a/shared/consts.ts
+++ b/shared/consts.ts
@@ -1,8 +1,15 @@
/**
* 缓存过期时间
*/
+import packageJSON from "../package.json"
+
export const TTL = 30 * 60 * 1000
/**
* 默认刷新间隔, 10 min
*/
export const Interval = 10 * 60 * 1000
+
+export const Homepage = packageJSON.homepage
+
+export const Version = packageJSON.version
+export const Author = packageJSON.author
diff --git a/src/components/header.tsx b/src/components/header.tsx
index a0c30d5..a020541 100644
--- a/src/components/header.tsx
+++ b/src/components/header.tsx
@@ -4,6 +4,7 @@ import { useAtomValue, useSetAtom } from "jotai"
import { useIsFetching } from "@tanstack/react-query"
import clsx from "clsx"
import type { SourceID } from "@shared/types"
+import { Homepage, Version } from "@shared/consts"
import logo from "~/assets/react.svg"
import { useDark } from "~/hooks/useDark"
import { currentSectionAtom, refetchSourcesAtom } from "~/atoms"
@@ -20,6 +21,10 @@ function ThemeToggle() {
)
}
+export function GithubIcon() {
+ return
+}
+
function RefreshButton() {
const currentSection = useAtomValue(currentSectionAtom)
const setRefetchSource = useSetAtom(refetchSourcesAtom)
@@ -44,15 +49,19 @@ function RefreshButton() {
export function Header() {
return (
-
+ <>
NewsNow
+
+ {`v${Version}`}
+
-