success
This commit is contained in:
parent
b8692d064c
commit
7ae25c68ba
@ -4,10 +4,14 @@ import {Link} from 'react-router-dom';
|
|||||||
import DefaultPicture from '../assets/profile.jpg'
|
import DefaultPicture from '../assets/profile.jpg'
|
||||||
import { motion, AnimatePresence } from 'framer-motion'
|
import { motion, AnimatePresence } from 'framer-motion'
|
||||||
import Modal from './Sidebar/Modal.tsx';
|
import Modal from './Sidebar/Modal.tsx';
|
||||||
|
import YellowAlert from './Alert/YellowAlert.tsx';
|
||||||
import '../styles/Header.css';
|
import '../styles/Header.css';
|
||||||
|
|
||||||
import api from '../script/axiosApi.tsx';
|
import api from '../script/axiosApi.tsx';
|
||||||
|
|
||||||
|
import { MdQrCodeScanner } from 'react-icons/md';
|
||||||
|
import { GiWingedSword, GiCrownedSkull } from 'react-icons/gi';
|
||||||
|
|
||||||
function Header() {
|
function Header() {
|
||||||
// const [sidebar, setSidebar] = useState(false);
|
// const [sidebar, setSidebar] = useState(false);
|
||||||
// const showSidebar = () => setSidebar(!sidebar);
|
// const showSidebar = () => setSidebar(!sidebar);
|
||||||
@ -15,6 +19,8 @@ function Header() {
|
|||||||
const close = () => setModalOpen(false);
|
const close = () => setModalOpen(false);
|
||||||
const open = () => setModalOpen(true);
|
const open = () => setModalOpen(true);
|
||||||
|
|
||||||
|
const [success, setSuccess] = useState([]);
|
||||||
|
|
||||||
const [profilePicture, setProfilePicture] = useState('');
|
const [profilePicture, setProfilePicture] = useState('');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -23,6 +29,8 @@ function Header() {
|
|||||||
const user = await api.get("/profile");
|
const user = await api.get("/profile");
|
||||||
const pic = await api.post("/getPicture", {username: user.data.username})
|
const pic = await api.post("/getPicture", {username: user.data.username})
|
||||||
setProfilePicture(pic.data);
|
setProfilePicture(pic.data);
|
||||||
|
// console.log("test ===", user.data)
|
||||||
|
setSuccess(user.data);
|
||||||
// console.log(`profile pic222= ${pic.data}`)
|
// console.log(`profile pic222= ${pic.data}`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching profile picture:', error);
|
console.error('Error fetching profile picture:', error);
|
||||||
@ -45,6 +53,18 @@ function Header() {
|
|||||||
</Link>
|
</Link>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
<div className='end'>
|
<div className='end'>
|
||||||
|
|
||||||
|
{success.otp_verified ? (
|
||||||
|
<MdQrCodeScanner className='success' />
|
||||||
|
):("")}
|
||||||
|
{success.win >= 2 ? (
|
||||||
|
<GiWingedSword className="success" />
|
||||||
|
):("")}
|
||||||
|
|
||||||
|
{success.win >= 5 ? (
|
||||||
|
<GiCrownedSkull className="success" />
|
||||||
|
):("")}
|
||||||
|
|
||||||
<Link to="/profile" className='menu-bars'>
|
<Link to="/profile" className='menu-bars'>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
|
|||||||
@ -89,6 +89,16 @@ span {
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.success {
|
||||||
|
height: 25px;
|
||||||
|
width: 25px;
|
||||||
|
/* border: solid; */
|
||||||
|
margin-top: 2.5vh;
|
||||||
|
margin-left: 1vh;
|
||||||
|
/* border-color: black; */
|
||||||
|
/* border-radius: 50%; */
|
||||||
|
}
|
||||||
|
|
||||||
.header-pic{
|
.header-pic{
|
||||||
text-align: end;
|
text-align: end;
|
||||||
/* id: right; */
|
/* id: right; */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user