split page to smaller components
This commit is contained in:
parent
150311472e
commit
fd67ff2114
4 changed files with 192 additions and 172 deletions
42
source/src/pages/Page/Meta.tsx
Normal file
42
source/src/pages/Page/Meta.tsx
Normal file
|
@ -0,0 +1,42 @@
|
|||
import styled from "styled-components"
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
||||
import {
|
||||
faBook,
|
||||
faCalendar,
|
||||
faHourglass,
|
||||
} from "@fortawesome/free-solid-svg-icons"
|
||||
|
||||
import { FetchedPage } from "../../types/typings"
|
||||
import theming from "../../styles/theming"
|
||||
|
||||
const StyledMetaContainer = styled.div`
|
||||
color: ${(props) =>
|
||||
theming.theme(props.theme.currentTheme, {
|
||||
light: "#555",
|
||||
dark: "#CCC",
|
||||
})};
|
||||
`
|
||||
|
||||
const Meta = (props: { fetchedPage: FetchedPage }) => {
|
||||
return (
|
||||
<StyledMetaContainer>
|
||||
<FontAwesomeIcon icon={faCalendar} />
|
||||
|
||||
{props.fetchedPage.date || "Unknown date"}
|
||||
|
||||
<FontAwesomeIcon icon={faHourglass} />
|
||||
|
||||
{props.fetchedPage.readTime
|
||||
? props.fetchedPage.readTime + " read"
|
||||
: "unknown length"}
|
||||
|
||||
<FontAwesomeIcon icon={faBook} />
|
||||
|
||||
{props.fetchedPage.wordCount
|
||||
? props.fetchedPage.wordCount + " words"
|
||||
: "unknown words"}
|
||||
</StyledMetaContainer>
|
||||
)
|
||||
}
|
||||
|
||||
export default Meta
|
Loading…
Add table
Add a link
Reference in a new issue