refact: rename 404 hint component

This commit is contained in:
Jean-Philippe Sirois
2020-08-07 04:45:50 -04:00
parent 5a7c0bca16
commit 9044257b13
4 changed files with 6 additions and 6 deletions
@@ -55,14 +55,14 @@ function levenshteinDistance(term1: string, term2: string) {
return matrix[term2.length][term1.length]
}
interface IPossibleCorrections {
interface IFourZeroFourHint {
basepath: string
location: WindowLocation
data: { allFile: FileConnection }
threshold?: number
}
export const PossibleCorrections: FC<IPossibleCorrections> = ({
export const FourZeroFourHint: FC<IFourZeroFourHint> = ({
basepath,
location,
data,
+2 -2
View File
@@ -6,7 +6,7 @@ import { FileConnection } from "../../../generated/graphql"
import { ComponentQuery } from "../../../typings"
import { SEO } from "../../components/SEO"
import { PossibleCorrections } from "../../components/404LinkCorrection"
import { FourZeroFourHint } from "../../components/FourZeroFourHint"
import { FourZeroFour } from "../../components/FourZeroFour"
export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => (
@@ -15,7 +15,7 @@ export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => (
<FourZeroFour title="ARCHIVE NOT FOUND">
<Location>
{({ location }) => (
<PossibleCorrections
<FourZeroFourHint
basepath="archives/"
location={location}
data={data}
+2 -2
View File
@@ -4,7 +4,7 @@ import React, { Fragment } from "react"
import { FileConnection } from "../../../generated/graphql"
import { ComponentQuery } from "../../../typings"
import { PossibleCorrections } from "../../components/404LinkCorrection"
import { FourZeroFourHint } from "../../components/FourZeroFourHint"
import { SEO } from "../../components/SEO"
import { FourZeroFour } from "../../components/FourZeroFour"
@@ -14,7 +14,7 @@ export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => (
<FourZeroFour title="RESOURCE NOT FOUND">
<Location>
{({ location }) => (
<PossibleCorrections
<FourZeroFourHint
basepath="resources/"
location={location}
data={data}