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] return matrix[term2.length][term1.length]
} }
interface IPossibleCorrections { interface IFourZeroFourHint {
basepath: string basepath: string
location: WindowLocation location: WindowLocation
data: { allFile: FileConnection } data: { allFile: FileConnection }
threshold?: number threshold?: number
} }
export const PossibleCorrections: FC<IPossibleCorrections> = ({ export const FourZeroFourHint: FC<IFourZeroFourHint> = ({
basepath, basepath,
location, location,
data, data,
+2 -2
View File
@@ -6,7 +6,7 @@ import { FileConnection } from "../../../generated/graphql"
import { ComponentQuery } from "../../../typings" import { ComponentQuery } from "../../../typings"
import { SEO } from "../../components/SEO" import { SEO } from "../../components/SEO"
import { PossibleCorrections } from "../../components/404LinkCorrection" import { FourZeroFourHint } from "../../components/FourZeroFourHint"
import { FourZeroFour } from "../../components/FourZeroFour" import { FourZeroFour } from "../../components/FourZeroFour"
export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => ( export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => (
@@ -15,7 +15,7 @@ export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => (
<FourZeroFour title="ARCHIVE NOT FOUND"> <FourZeroFour title="ARCHIVE NOT FOUND">
<Location> <Location>
{({ location }) => ( {({ location }) => (
<PossibleCorrections <FourZeroFourHint
basepath="archives/" basepath="archives/"
location={location} location={location}
data={data} data={data}
+2 -2
View File
@@ -4,7 +4,7 @@ import React, { Fragment } from "react"
import { FileConnection } from "../../../generated/graphql" import { FileConnection } from "../../../generated/graphql"
import { ComponentQuery } from "../../../typings" import { ComponentQuery } from "../../../typings"
import { PossibleCorrections } from "../../components/404LinkCorrection" import { FourZeroFourHint } from "../../components/FourZeroFourHint"
import { SEO } from "../../components/SEO" import { SEO } from "../../components/SEO"
import { FourZeroFour } from "../../components/FourZeroFour" import { FourZeroFour } from "../../components/FourZeroFour"
@@ -14,7 +14,7 @@ export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => (
<FourZeroFour title="RESOURCE NOT FOUND"> <FourZeroFour title="RESOURCE NOT FOUND">
<Location> <Location>
{({ location }) => ( {({ location }) => (
<PossibleCorrections <FourZeroFourHint
basepath="resources/" basepath="resources/"
location={location} location={location}
data={data} data={data}