add submissions and user menu z index

This commit is contained in:
NCanggoro 2023-10-03 14:38:14 +07:00
parent c9d6118f0c
commit f4f5799590
2 changed files with 10 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import React, { TargetedEvent } from "preact/compat"; import React from "preact/compat";
import { useState } from "preact/hooks"; import { useState } from "preact/hooks";
import { useSelector, useDispatch } from "react-redux"; import { useSelector, useDispatch } from "react-redux";
import { UserRootState } from "../../store/type"; import { UserRootState } from "../../store/type";
@ -71,7 +71,7 @@ function Header() {
</div> </div>
} }
</div> </div>
<form onSubmit={onSearchSubmit} className={`search-input ${dropdown ? "search-input-dropdown" : ""}`}> <form onSubmit={onSearchSubmit} className={`header-search-input ${dropdown ? "search-input-dropdown" : ""}`}>
<label> <label>
<input <input
type="text" type="text"
@ -101,7 +101,10 @@ function Header() {
<div className={'profile-dropdown bg-secondary ml-6'} style={pageState.profileMenu ? { display: 'block' } : {display: 'none'}}> <div className={'profile-dropdown bg-secondary ml-6'} style={pageState.profileMenu ? { display: 'block' } : {display: 'none'}}>
<a href={'#'}><div className={'p-1'}>Profile</div></a> <a href={'#'}><div className={'p-1'}>Profile</div></a>
<a href={'#'}><div className={'p-1'}>Feed</div></a> <a href={'#'}><div className={'p-1'}>Feed</div></a>
<a href={'#'}><div className={'p-1'}>Add location</div></a> <a href={'/add-location'}><div className={'p-1'}>Add location</div></a>
{user.is_admin &&
<a href={'/submissions'} ><div className={'p-1'}>Submissions</div></a>
}
<a href={'#'} onClick={handleLogout}><div className={'p-1'}>Logout</div></a> <a href={'#'} onClick={handleLogout}><div className={'p-1'}>Logout</div></a>
{/* <div className={'p-2'}><a href={'#'}>Halo</a></div> */} {/* <div className={'p-2'}><a href={'#'}>Halo</a></div> */}
{/* <div className={'p-2'}><a href={'#'}>Halo</a></div> */} {/* <div className={'p-2'}><a href={'#'}>Halo</a></div> */}

View File

@ -3,11 +3,11 @@
} }
label { .header-search-input label {
position: relative; position: relative;
} }
label:before { .header-search-input label:before {
content: ""; content: "";
position: absolute; position: absolute;
left: 10px; left: 10px;
@ -41,6 +41,7 @@ label:before {
padding: 5px; padding: 5px;
width: 135px; width: 135px;
font-size: 13px; font-size: 13px;
z-index: 9999;
} }
.profile-dropdown a div:hover { .profile-dropdown a div:hover {
@ -76,7 +77,7 @@ label:before {
text-align: 'center'; */ text-align: 'center'; */
} }
.search-input { .header-search-input {
margin-left: auto; margin-left: auto;
} }