Skip to content

Commit 94c96a4

Browse files
committed
migrate header to ts
1 parent f031a94 commit 94c96a4

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

src/App.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useState, useEffect } from 'react'
22
import './App.css'
3-
import { Footer } from 'src/components/Layout'
4-
import Header from 'src/components/Header'
3+
import { Footer, Header } from 'src/components/Layout'
54
import { BookmarksSidebar } from 'src/features/bookmarks'
65
import { MarketingBanner } from 'src/components/Elements'
76
import ScrollCardsNavigator from './components/ScrollCardsNavigator'
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BsFillGearFill } from 'react-icons/bs'
33
import { CgTab } from 'react-icons/cg'
44
import { BsFillBookmarksFill } from 'react-icons/bs'
55
import { ReactComponent as HackertabLogo } from 'src/assets/logo.svg'
6-
import { UserTags } from './Elements/UserTags'
6+
import { UserTags } from 'src/components/Elements/UserTags'
77
import { SettingsModal } from 'src/features/settings'
88
import { BsMoon } from 'react-icons/bs'
99
import { IoMdSunny } from 'react-icons/io'
@@ -12,7 +12,19 @@ import { SearchBar } from 'src/components/Elements/SearchBar'
1212
import { useUserPreferences } from 'src/stores/preferences'
1313
import { useBookmarks } from 'src/stores/bookmarks'
1414

15-
function Header({ showSideBar, setShowSideBar, showSettings, setShowSettings }) {
15+
type HeaderProps = {
16+
showSideBar: boolean
17+
setShowSideBar: (show: boolean) => void
18+
showSettings: boolean
19+
setShowSettings: (show: boolean) => void
20+
}
21+
22+
export const Header = ({
23+
showSideBar,
24+
setShowSideBar,
25+
showSettings,
26+
setShowSettings,
27+
}: HeaderProps) => {
1628
const [themeIcon, setThemeIcon] = useState(<BsMoon />)
1729
const isFirstRun = useRef(true)
1830
const { theme, setTheme } = useUserPreferences()
@@ -94,5 +106,3 @@ function Header({ showSideBar, setShowSideBar, showSettings, setShowSettings })
94106
</>
95107
)
96108
}
97-
98-
export default Header

src/components/Layout/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export * from "./Header"
12
export * from "./Footer"

0 commit comments

Comments
 (0)