perf: add version link

This commit is contained in:
molvqingtai 2024-10-02 18:21:42 +08:00
parent 1f44af873c
commit 4551ad2964
3 changed files with 23 additions and 1 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "web-chat", "name": "web-chat",
"displayName": "WebChat", "displayName": "WebChat",
"version": "1.0.28", "version": "1.0.0",
"description": "Chat with anyone on any website.", "description": "Chat with anyone on any website.",
"type": "module", "type": "module",
"scripts": { "scripts": {

View file

@ -3,10 +3,12 @@ import Main from './components/Main'
import ProfileForm from './components/ProfileForm' import ProfileForm from './components/ProfileForm'
import BadgeList from './components/BadgeList' import BadgeList from './components/BadgeList'
import Layout from './components/Layout' import Layout from './components/Layout'
import VersionLink from './components/VersionLink'
function App() { function App() {
return ( return (
<Layout> <Layout>
<VersionLink></VersionLink>
<Main> <Main>
<ProfileForm></ProfileForm> <ProfileForm></ProfileForm>
<Toaster richColors position="top-center" /> <Toaster richColors position="top-center" />

View file

@ -0,0 +1,20 @@
import { FC } from 'react'
import { Button } from '@/components/ui/Button'
import Link from '@/components/Link'
import { version } from '@/../package.json'
const VersionLink: FC = () => {
return (
<Button
size="lg"
variant="ghost"
className="fixed right-4 top-2 rounded-full px-3 text-base font-medium text-primary"
>
<Link href="https://github.com/molvqingtai/WebChat/releases">Version: v{version}</Link>
</Button>
)
}
VersionLink.displayName = 'VersionLink'
export default VersionLink