mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-08 07:56:12 +02:00
refact: rename 404 hint component
This commit is contained in:
+2
-2
@@ -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,
|
||||||
@@ -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}
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user