Skip to content

Commit

Permalink
chore: update navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
YuzeTT committed Nov 21, 2023
1 parent 99aa5bc commit ea49f88
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
10 changes: 10 additions & 0 deletions src/components/AccountButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import isVip from "../utils/isVip"

export default function AccountButton() {
return (
<a href='/user' className={`p-1 rounded-full flex items-center ${isVip().level===0?'bg-green-100 text-green-700':isVip().level === '1'?'bg-[#E8BD87] text-[#FFFFFF]':isVip().level === '100'?'bg-blue-500 text-[#FFFFFF]':''}`}>
<div className="i-ri-account-circle-fill text-xl" />
<div className='text-sm mx-1'>{isVip().level==100?'管理站点':'我的账户'}</div>
</a>
)
}
7 changes: 2 additions & 5 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useLocation, useNavigate } from "react-router-dom"
// import { useLocation } from 'react-router';
import list from '../utils/router';
import AccountButton from "./AccountButton";
// import { useState } from 'react'
// import { Alert } from 'antd';
// import { useState } from "react";

// import { motion } from "framer-motion"
import isVip from "../utils/isVip"

export default function Navbar() {
const navigate = useNavigate();
Expand Down Expand Up @@ -93,10 +93,7 @@ export default function Navbar() {
</div>:''
} */}
{/* <button onClick={()=>{setShowText(!showText)}}></button> */}
<a href='/user' className={`p-1 rounded-full flex items-center ${isVip().level===0?'bg-green-100 text-green-700':isVip().level === '1'?'bg-[#E8BD87] text-[#FFFFFF]':isVip().level === '100'?'bg-blue-500 text-[#FFFFFF]':''}`}>
<div className="i-ri-account-circle-fill text-xl" />
<div className='text-sm mx-1'>{isVip().level==100?'管理站点':'我的账户'}</div>
</a>
<AccountButton />
{/* <motion.div className='flex justify-end flex-1 items-center space-x-2'> */}
{/* <div className='flex items-center p-1 bg-zinc-100 rounded-xl card'>
<div className='px-2'>
Expand Down
8 changes: 6 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { CopyToClipboard } from 'react-copy-to-clipboard';
import list from '../utils/router'
// import FollowMe from '../components/FollowMe';
import isVip from '../utils/isVip';
import AccountButton from "../components/AccountButton";

export default function index() {
const navigate = useNavigate();
Expand Down Expand Up @@ -75,10 +76,13 @@ export default function index() {
</a>
</div>

<a href='/user' className='absolute top-0 right-0 m-4 bg-green-100 p-1 rounded-full flex items-center text-green-700'>
{/* <a href='/user' className='absolute top-0 right-0 m-4 bg-green-100 p-1 rounded-full flex items-center text-green-700'>
<div className="i-ri-account-circle-fill text-xl" />
<div className='text-sm mx-1'>我的账户</div>
</a>
</a> */}
<div className='absolute top-0 right-0 m-4'>
<AccountButton />
</div>
</div>
<div text='sm' op50 mb-2>已完成</div>
<div className='grid grid-cols-2 md:grid-cols-3 gap-3'>
Expand Down

0 comments on commit ea49f88

Please sign in to comment.