🐛 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 { notificationCenter } = useContext(alertContext);
|
||||
const location = useLocation();
|
||||
const { logout, autoLogin } = useContext(AuthContext);
|
||||
const { logout, autoLogin, isAdmin, setIsAdmin } = useContext(AuthContext);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const [stars, setStars] = useState(null);
|
||||
|
||||
const { isAdmin, setIsAdmin } = useContext(AuthContext);
|
||||
|
||||
// Get and set numbers of stars on header
|
||||
useEffect(() => {
|
||||
async function fetchStars() {
|
||||
|
|
@ -141,16 +139,18 @@ export default function Header() {
|
|||
/>
|
||||
</div>
|
||||
</AlertDropdown>
|
||||
<button
|
||||
onClick={() => {
|
||||
navigate("/account/api-keys");
|
||||
}}
|
||||
>
|
||||
<IconComponent
|
||||
name="Key"
|
||||
className="side-bar-button-size text-muted-foreground hover:text-accent-foreground"
|
||||
/>
|
||||
</button>
|
||||
{!autoLogin && (
|
||||
<button
|
||||
onClick={() => {
|
||||
navigate("/account/api-keys");
|
||||
}}
|
||||
>
|
||||
<IconComponent
|
||||
name="Key"
|
||||
className="side-bar-button-size text-muted-foreground hover:text-accent-foreground"
|
||||
/>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue