Skip to content

Commit

Permalink
update: ESlintのエラーが消えた
Browse files Browse the repository at this point in the history
  • Loading branch information
yukyu30 committed Apr 30, 2022
2 parents 36a914f + 9103ca9 commit f337c5e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/components/PageSEO.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Head from "next/head";

import { config } from "@site.config";

// types
Expand Down
7 changes: 5 additions & 2 deletions src/components/SiteHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Link from "next/link";
import Image from "next/image";
import { config } from "@site.config";
import { ThemeChanger } from '@src/components/ThemeChanger';
import { ThemeChanger } from "@src/components/ThemeChanger";
import { ContentWrapper } from "@src/components/ContentWrapper";

export const SiteHeader: React.FC = () => (
Expand All @@ -9,8 +10,10 @@ export const SiteHeader: React.FC = () => (
<div className="site-header__inner">
<Link href="/" passHref>
<a className="site-header__logo-link">
<img
<Image
src="/logo.svg"
width={80}
height={80}
alt={config.siteMeta.title}
className="site-header__logo-img"
/>
Expand Down
13 changes: 7 additions & 6 deletions src/components/ThemeChanger.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useTheme } from 'next-themes'
import { useTheme } from "next-themes"
import Image from "next/image"
import { useState, useEffect } from "react";

export const ThemeChanger = () => {
Expand All @@ -7,15 +8,15 @@ export const ThemeChanger = () => {

// When mounted on client, now we can show the UI
useEffect(() => setMounted(true), [])

const { theme, setTheme } = useTheme()
if (!mounted) {
return null
}
const { theme, setTheme } = useTheme()
 if(theme === 'dark'){

if(theme === 'dark'){
return (
<button className="theme-changer_button" onClick={() => setTheme('light')}>
<img
<Image
src="/icons/lightmode.svg"
alt={`ライトテーマに切り替える`}
width={30}
Expand All @@ -27,7 +28,7 @@ export const ThemeChanger = () => {

return (
<button className="theme-changer_button" onClick={() => setTheme('dark')}>
<img
<Image
src="/icons/darkmode.svg"
alt={`ダークモードに切り替える`}
width={30}
Expand Down

0 comments on commit f337c5e

Please sign in to comment.