bumped package versions
This commit is contained in:
parent
462084381e
commit
44c17577d1
5 changed files with 435 additions and 555 deletions
|
@ -21,59 +21,58 @@
|
|||
"@fortawesome/free-brands-svg-icons": "^5.15.4",
|
||||
"@fortawesome/free-regular-svg-icons": "^5.15.4",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
||||
"@fortawesome/react-fontawesome": "^0.1.15",
|
||||
"@types/elasticlunr": "^0.9.3",
|
||||
"@types/highlight.js": "^10.1.0",
|
||||
"@types/react-router-hash-link": "^2.4.2",
|
||||
"@types/react-select": "^4.0.18",
|
||||
"date-fns": "^2.24.0",
|
||||
"@fortawesome/react-fontawesome": "^0.1.16",
|
||||
"date-fns": "^2.27.0",
|
||||
"elasticlunr": "^0.9.5",
|
||||
"gray-matter": "^4.0.3",
|
||||
"highlight.js": "^11.2.0",
|
||||
"katex": "^0.13.18",
|
||||
"highlight.js": "^11.3.1",
|
||||
"katex": "^0.15.1",
|
||||
"local-storage-fallback": "^4.1.2",
|
||||
"markdown-it": "^12.2.0",
|
||||
"markdown-it-anchor": "^8.3.1",
|
||||
"markdown-it": "^12.3.0",
|
||||
"markdown-it-anchor": "^8.4.1",
|
||||
"markdown-it-attrs": "^4.1.0",
|
||||
"markdown-it-texmath": "^0.9.1",
|
||||
"markdown-it-texmath": "^0.9.6",
|
||||
"markdown-toc": "^1.2.0",
|
||||
"query-string": "^7.0.1",
|
||||
"react": "^17.0.2",
|
||||
"react-collapse": "^5.1.0",
|
||||
"react-collapse": "^5.1.1",
|
||||
"react-date-range": "^1.4.0",
|
||||
"react-device-detect": "^2.0.0",
|
||||
"react-device-detect": "^2.1.2",
|
||||
"react-dnd": "^14.0.4",
|
||||
"react-dnd-html5-backend": "^14.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-helmet-async": "^1.1.2",
|
||||
"react-router-dom": "^5.3.0",
|
||||
"react-helmet-async": "^1.2.2",
|
||||
"react-router-dom": "^6.1.1",
|
||||
"react-router-hash-link": "^2.4.3",
|
||||
"react-scripts": "^4.0.3",
|
||||
"react-select": "^5.0.0",
|
||||
"react-select": "^5.2.1",
|
||||
"react-tooltip": "^4.2.21",
|
||||
"read-time-estimate": "^0.0.3",
|
||||
"styled-components": "^5.3.1",
|
||||
"web-vitals": "^2.1.0"
|
||||
"styled-components": "^5.3.3",
|
||||
"web-vitals": "^2.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/elasticlunr": "^0.9.4",
|
||||
"@types/highlight.js": "^10.1.0",
|
||||
"@types/katex": "^0.11.1",
|
||||
"@types/markdown-it": "^12.2.1",
|
||||
"@types/node": "^16.10.1",
|
||||
"@types/react": "^17.0.24",
|
||||
"@types/markdown-it": "^12.2.3",
|
||||
"@types/node": "^16.11.12",
|
||||
"@types/react": "^17.0.37",
|
||||
"@types/react-collapse": "^5.0.1",
|
||||
"@types/react-date-range": "^1.1.8",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"@types/styled-components": "^5.1.14",
|
||||
"@typescript-eslint/eslint-plugin": "^4.32.0",
|
||||
"@typescript-eslint/parser": "^4.32.0",
|
||||
"eslint": "^7.32.0",
|
||||
"@types/react-date-range": "^1.4.1",
|
||||
"@types/react-dom": "^17.0.11",
|
||||
"@types/react-router-hash-link": "^2.4.4",
|
||||
"@types/react-select": "^5.0.1",
|
||||
"@types/styled-components": "^5.1.18",
|
||||
"@typescript-eslint/eslint-plugin": "^5.7.0",
|
||||
"@typescript-eslint/parser": "^5.7.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-json": "^3.1.0",
|
||||
"eslint-plugin-react": "^7.26.0",
|
||||
"prettier": "^2.4.1",
|
||||
"ts-node": "^10.2.1",
|
||||
"eslint-plugin-react": "^7.27.1",
|
||||
"prettier": "^2.5.1",
|
||||
"ts-node": "^10.4.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"typescript": "^4.4.3"
|
||||
"typescript": "^4.5.4"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from "react"
|
||||
import { Switch, Route } from "react-router-dom"
|
||||
import { Routes, Route } from "react-router-dom"
|
||||
import styled, {
|
||||
ThemeProvider,
|
||||
createGlobalStyle,
|
||||
|
@ -333,29 +333,22 @@ export default class App extends React.Component<AppProps, AppState> {
|
|||
{this.state.isLoading ? (
|
||||
<Loading />
|
||||
) : (
|
||||
<Switch>
|
||||
<Route exact path="/">
|
||||
<Routes>
|
||||
<Route
|
||||
path="/"
|
||||
element={
|
||||
<PostList howMany={4} title="Home" />
|
||||
</Route>
|
||||
}
|
||||
/>
|
||||
|
||||
<Route exact path="/loading">
|
||||
<Loading />
|
||||
</Route>
|
||||
<Route path="/loading" element={<Loading />} />
|
||||
|
||||
<Route exact path="/search">
|
||||
<Search />
|
||||
</Route>
|
||||
<Route path="/search" element={<Search />} />
|
||||
|
||||
<Route exact path="/404">
|
||||
<NotFound />
|
||||
</Route>
|
||||
<Route path="/404" element={<NotFound />} />
|
||||
|
||||
<Route exact path="/:path*">
|
||||
{({ match }) => (
|
||||
<Page key={match?.params.path} />
|
||||
)}
|
||||
</Route>
|
||||
</Switch>
|
||||
<Route path="/:path*" element={<Page />} />
|
||||
</Routes>
|
||||
)}
|
||||
</StyledContentContainer>
|
||||
<Footer />
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import styled from "styled-components"
|
||||
import { useHistory } from "react-router-dom"
|
||||
import { useNavigate } from "react-router-dom"
|
||||
|
||||
import theming from "../theming"
|
||||
|
||||
|
@ -65,16 +65,14 @@ interface PostCardProps {
|
|||
}
|
||||
|
||||
export default function PostCard(props: PostCardProps) {
|
||||
const history = useHistory()
|
||||
const navigate = useNavigate()
|
||||
|
||||
return (
|
||||
<StyledPostCard
|
||||
key={props.postData.url}
|
||||
className="card main-content"
|
||||
onClick={() => {
|
||||
history.push({
|
||||
pathname: process.env.PUBLIC_URL + props.postData.url,
|
||||
})
|
||||
navigate(process.env.PUBLIC_URL + props.postData.url)
|
||||
}}
|
||||
>
|
||||
<StyledTitle>{props.postData?.title || "No title"}</StyledTitle>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
/* eslint-disable react/prop-types */
|
||||
|
||||
import { useEffect, useState, useRef } from "react"
|
||||
import styled, { ThemeConsumer } from "styled-components"
|
||||
import { useLocation, useHistory } from "react-router-dom"
|
||||
import { useLocation, useNavigate, useSearchParams } from "react-router-dom"
|
||||
import { Helmet } from "react-helmet-async"
|
||||
import { DateRange, Range, OnDateRangeChangeProps } from "react-date-range"
|
||||
import { DateRange, Range } from "react-date-range"
|
||||
import Select from "react-select"
|
||||
import queryString from "query-string" // parsing url query
|
||||
import elasticlunr from "elasticlunr" // search engine
|
||||
|
@ -151,7 +153,9 @@ function isSelectedTagsInPost(
|
|||
export default () => {
|
||||
const inputRef = useRef<HTMLInputElement>(null)
|
||||
|
||||
const _history = useHistory()
|
||||
const navigate = useNavigate()
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const [_, setSearchParams] = useSearchParams()
|
||||
const _location = useLocation()
|
||||
|
||||
// todo: handle duplicate/missing keys
|
||||
|
@ -180,9 +184,8 @@ export default () => {
|
|||
)
|
||||
|
||||
function doSearch() {
|
||||
_history.push({
|
||||
pathname: "/search",
|
||||
search: queryString.stringify({
|
||||
navigate("/search")
|
||||
setSearchParams({
|
||||
...(searchInput && {
|
||||
query: searchInput,
|
||||
}),
|
||||
|
@ -195,7 +198,6 @@ export default () => {
|
|||
...(query.tags.length > 0 && {
|
||||
tags: query.tags.join(","),
|
||||
}),
|
||||
}),
|
||||
})
|
||||
|
||||
try {
|
||||
|
@ -242,22 +244,19 @@ export default () => {
|
|||
}, [searchInput])
|
||||
|
||||
function clearDate() {
|
||||
_history.push({
|
||||
pathname: "/search",
|
||||
search: queryString.stringify({
|
||||
navigate("/search")
|
||||
setSearchParams({
|
||||
...(query.query && {
|
||||
query: query.query,
|
||||
}),
|
||||
...(query.tags.length > 0 && {
|
||||
tags: query.tags.join(","),
|
||||
}),
|
||||
}),
|
||||
})
|
||||
|
||||
setDateRange(defaultDateRange)
|
||||
}
|
||||
|
||||
function onDateRangeChange(item: OnDateRangeChangeProps) {
|
||||
function onDateRangeChange(item: { [key: string]: Range }) {
|
||||
const historyToPush = {
|
||||
...(query.query && {
|
||||
query: query.query,
|
||||
|
@ -272,7 +271,6 @@ export default () => {
|
|||
tags: query.tags.join(","),
|
||||
}),
|
||||
}
|
||||
console.log(item)
|
||||
|
||||
// convert Date to YYYY-MM-DD string if it exists
|
||||
if (item.selection.startDate != null)
|
||||
|
@ -285,11 +283,8 @@ export default () => {
|
|||
.toISOString()
|
||||
.split("T")[0]
|
||||
|
||||
_history.push({
|
||||
pathname: "/search",
|
||||
search: queryString.stringify(historyToPush),
|
||||
})
|
||||
|
||||
navigate("/search")
|
||||
setSearchParams(historyToPush)
|
||||
setDateRange([item.selection])
|
||||
}
|
||||
|
||||
|
@ -357,8 +352,14 @@ interface TagSelectProps {
|
|||
setSelectedOption: React.Dispatch<React.SetStateAction<TagsData[] | null>>
|
||||
}
|
||||
|
||||
const TagSelect = (props: TagSelectProps) => {
|
||||
const _history = useHistory()
|
||||
const TagSelect: React.FC<TagSelectProps> = ({
|
||||
query,
|
||||
selectedTags,
|
||||
setSelectedOption,
|
||||
}) => {
|
||||
const navigate = useNavigate()
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const [_, setSearchParams] = useSearchParams()
|
||||
|
||||
return (
|
||||
<StyledReactTagsContainer>
|
||||
|
@ -452,28 +453,29 @@ const TagSelect = (props: TagSelectProps) => {
|
|||
},
|
||||
}),
|
||||
}}
|
||||
defaultValue={props.selectedTags}
|
||||
defaultValue={selectedTags}
|
||||
onChange={(newSelectedTags) => {
|
||||
props.setSelectedOption(
|
||||
newSelectedTags as TagsData[]
|
||||
)
|
||||
setSelectedOption(newSelectedTags as TagsData[])
|
||||
|
||||
_history.push({
|
||||
pathname: "/search",
|
||||
search: queryString.stringify({
|
||||
...(props.query.query && {
|
||||
query: props.query.query,
|
||||
}),
|
||||
...(props.query.from && {
|
||||
from: props.query.from,
|
||||
}),
|
||||
...(props.query.to && {
|
||||
to: props.query.to,
|
||||
}),
|
||||
tags:
|
||||
navigate("/search")
|
||||
|
||||
const tags =
|
||||
newSelectedTags
|
||||
.map((elem) => elem.value)
|
||||
.join(",") || undefined,
|
||||
.join(",") || undefined
|
||||
|
||||
setSearchParams({
|
||||
...(query.query && {
|
||||
query: query.query,
|
||||
}),
|
||||
...(query.from && {
|
||||
from: query.from,
|
||||
}),
|
||||
...(query.to && {
|
||||
to: query.to,
|
||||
}),
|
||||
...(tags && {
|
||||
tags: tags,
|
||||
}),
|
||||
})
|
||||
}}
|
||||
|
|
772
source/yarn.lock
772
source/yarn.lock
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue