🐛 fix(headerComponent): fix rendering issue with API keys button when autoLogin is true
✨ feat(headerComponent): add condition to render API keys button only when autoLogin is false
This commit is contained in:
parent
b15ab5bae0
commit
151bbc24d2
1 changed files with 13 additions and 13 deletions
|
|
@ -18,13 +18,11 @@ export default function Header() {
|
||||||
const { dark, setDark } = useContext(darkContext);
|
const { dark, setDark } = useContext(darkContext);
|
||||||
const { notificationCenter } = useContext(alertContext);
|
const { notificationCenter } = useContext(alertContext);
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { logout, autoLogin } = useContext(AuthContext);
|
const { logout, autoLogin, isAdmin, setIsAdmin } = useContext(AuthContext);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const [stars, setStars] = useState(null);
|
const [stars, setStars] = useState(null);
|
||||||
|
|
||||||
const { isAdmin, setIsAdmin } = useContext(AuthContext);
|
|
||||||
|
|
||||||
// Get and set numbers of stars on header
|
// Get and set numbers of stars on header
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchStars() {
|
async function fetchStars() {
|
||||||
|
|
@ -141,6 +139,7 @@ export default function Header() {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</AlertDropdown>
|
</AlertDropdown>
|
||||||
|
{!autoLogin && (
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate("/account/api-keys");
|
navigate("/account/api-keys");
|
||||||
|
|
@ -151,6 +150,7 @@ export default function Header() {
|
||||||
className="side-bar-button-size text-muted-foreground hover:text-accent-foreground"
|
className="side-bar-button-size text-muted-foreground hover:text-accent-foreground"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue