removed ugly css hack from navbar

This commit is contained in:
Kim, Jimin 2022-03-26 18:05:34 +09:00
parent fb00c98d1b
commit 775ae7f142
2 changed files with 15 additions and 10 deletions

View file

@ -1,11 +1,11 @@
import styled from "styled-components"
import { Link } from "react-router-dom"
import Sidebar from "../Sidebar"
import ThemeToggleButton from "./ThemeToggleButton"
import ReadProgress from "./ReadProgress"
import SearchButton from "./SearchButton"
import NavLinks from "./NavLinks"
import ThemeToggleButton from "./ThemeToggleButton"
import SearchButton from "./SearchButton"
import ReadProgress from "./ReadProgress"
import Sidebar from "../Sidebar"
import theming from "../../styles/theming"
@ -39,10 +39,12 @@ const StyledContainer = styled.div`
.screen_size2} + 20px)) {
width: calc(${theming.size.screen_size2} - 20px);
}
`
.right {
margin-left: auto;
}
const RightButtons = styled.div`
display: flex;
height: 100%;
margin-left: auto;
`
const StyledImg = styled.img`
@ -69,8 +71,12 @@ const Navbar = () => {
<NavLinks />
{/* right buttons */}
<ThemeToggleButton />
<SearchButton />
<RightButtons>
<ThemeToggleButton />
<SearchButton />
</RightButtons>
{/* etc */}
<Sidebar />
</StyledContainer>
<ReadProgress />

View file

@ -24,7 +24,6 @@ const Navbar = () => {
<StyledThemeButton
data-tip
data-for="theme"
className="right"
onClick={() => setTheme(currentTheme === "dark" ? "light" : "dark")}
>
{currentTheme == "dark" && <FontAwesomeIcon icon={faMoon} />}