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

View file

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