Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions app/public/icons.svg

This file was deleted.

Binary file added app/src/assets/allTools.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/assets/hero.png
Binary file not shown.
1 change: 0 additions & 1 deletion app/src/assets/react.svg

This file was deleted.

1 change: 0 additions & 1 deletion app/src/assets/vite.svg

This file was deleted.

30 changes: 5 additions & 25 deletions app/src/components/layouts/components/ToolHeader/ToolHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { useEffect, useState } from 'react'
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { Box, Menu, Star, X } from 'lucide-react'
import { APP_TITLE_UP, githubRepoUrl } from '@/constants'
import { useGithubStars } from '@/hooks/useGithubStars'
import './ToolHeader.scss'

const APP_NAME = import.meta.env.VITE_APP_TITLE_UP
const GITHUB_REPO = 'zeMinng/quick-kit'
const githubRepoUrl = `https://github.com/${GITHUB_REPO}`

const navLinks = [
{ label: '首页', to: '/' },
{ label: '工具台', to: '/tools' },
Expand All @@ -15,27 +13,9 @@ const navLinks = [

const ToolHeader: React.FC = () => {
const navigate = useNavigate()
const [starCount, setStarCount] = useState<string>('-')
const starCount = useGithubStars()
const [menuOpen, setMenuOpen] = useState(false)

useEffect(() => {
const loadStars = async () => {
try {
const res = await fetch(`https://api.github.com/repos/${GITHUB_REPO}`, {
headers: { Accept: 'application/vnd.github.v3+json' },
})
const data = await res.json()
setStarCount(
typeof data.stargazers_count === 'number' ? String(data.stargazers_count) : '-',
)
} catch {
setStarCount('-')
}
}

void loadStars()
}, [])

const go = (to: string) => {
setMenuOpen(false)
if (to.startsWith('/#')) {
Expand All @@ -57,7 +37,7 @@ const ToolHeader: React.FC = () => {
<div className="tool-header__logo">
<Box size={18} />
</div>
<span className="tool-header__title">{APP_NAME}</span>
<span className="tool-header__title">{APP_TITLE_UP}</span>
</div>

<nav className="tool-header__nav" aria-label="主导航">
Expand Down
Loading