Skip to content

Commit

Permalink
Merge pull request #133 from Go-phie/mobile-footer-menu
Browse files Browse the repository at this point in the history
mobile home icon changed to movie icon
  • Loading branch information
deven96 authored Apr 16, 2021
2 parents 53dd4f2 + 86b5a48 commit 8ed70af
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions src/components/mobileNav/MobileNavbar.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import React, { useState } from "react";
import Style from "./MobileNavbar.styles";
import SearchInput from "../searchInput/SearchInput";
import React, { useState } from 'react'
import Style from './MobileNavbar.styles'
import SearchInput from '../searchInput/SearchInput'
import {
HomeIcon,
SearchIcon,
SunIcon,
MoonIcon,
MusicNotes,
} from "../../utils/icons";
import { useHistory, useLocation } from "react-router";
MovieReel
} from '../../utils/icons'
import { useHistory, useLocation } from 'react-router'

const MobileNavbar = (props) => {
const [mobileSearch, setMobileSearch] = useState(false);
const location = useLocation();
console.log(location);
const history = useHistory();
const MobileNavbar = props => {
const [mobileSearch, setMobileSearch] = useState(false)
const location = useLocation()
console.log(location)
const history = useHistory()

return (
<>
<Style.MobileSearch
className={mobileSearch ? "show-mobile-searchbar" : ""}
className={mobileSearch ? 'show-mobile-searchbar' : ''}
>
<SearchInput
searchInput={props.searchInput}
Expand All @@ -31,22 +32,22 @@ const MobileNavbar = (props) => {
<Style.MobileNavbar>
<button
className={`${
location.pathname === "/Server1" ? "active" : ""
location.pathname === '/Server1' ? 'active' : ''
} actions-button`}
onClick={props.handleServerChange}
onChange={props.handleServerChange}
data-value="Server1"
title="Home"
data-value='Server1'
title='Home'
>
<HomeIcon />
{location.pathname === '/music' ? <MovieReel /> : <HomeIcon />}
</button>

{location.pathname === "/music" ? null : (
{location.pathname === '/music' ? null : (
<button
className={`${
location.pathname === "/search" ? "active" : ""
location.pathname === '/search' ? 'active' : ''
} actions-button`}
title="Search"
title='Search'
onClick={() => setMobileSearch(!mobileSearch)}
>
<SearchIcon />
Expand All @@ -55,24 +56,24 @@ const MobileNavbar = (props) => {

<button
className={`${
location.pathname === "/music" ? "active" : ""
location.pathname === '/music' ? 'active' : ''
} actions-button`}
title="Music"
onClick={() => history.push("/music")}
title='Music'
onClick={() => history.push('/music')}
>
<MusicNotes />
</button>

<button
className="actions-button"
title="Change Theme"
className='actions-button'
title='Change Theme'
onClick={props.switchTheme}
>
{props.theme === "dark" ? <SunIcon /> : <MoonIcon />}
{props.theme === 'dark' ? <SunIcon /> : <MoonIcon />}
</button>
</Style.MobileNavbar>
</>
);
};
)
}

export default MobileNavbar;
export default MobileNavbar

0 comments on commit 8ed70af

Please sign in to comment.