fix: 🐛 display the right option from select + update logo
Signed-off-by: slumbering <slumbering.pierrot@gmail.com>
This commit is contained in:
parent
b47512ba6e
commit
a959b420a2
Binary file not shown.
Before Width: | Height: | Size: 68 KiB |
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import logo from '../assets/dagger-logo.jpg'
|
||||
import logo from '../assets/dagger-logo.png'
|
||||
|
||||
export default function Logo(props) {
|
||||
return <img src={logo} alt="Logo" />
|
||||
|
@ -5,7 +5,7 @@ const Select = () => {
|
||||
const isBrowser = typeof window !== "undefined"
|
||||
const [tagsList, setTagsList] = useState([])
|
||||
const currentLocation = isBrowser ? window.location.pathname.split('/') : []
|
||||
currentLocation.pop() //remove last trailing slash
|
||||
currentLocation.shift() //remove last trailing slash
|
||||
|
||||
useEffect(() => {
|
||||
async function getTags() {
|
||||
@ -19,7 +19,7 @@ const Select = () => {
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<SelectStyled value={currentLocation[currentLocation.length - 1]} onChange={(e) => isBrowser ? window.location.pathname = `/${e.currentTarget.value}` : null}>
|
||||
<SelectStyled value={currentLocation[0]} onChange={(e) => isBrowser ? window.location.pathname = `/${e.currentTarget.value}` : null}>
|
||||
{tagsList.map(t => (
|
||||
<option>{t.tag}</option>
|
||||
))}
|
||||
|
Reference in New Issue
Block a user