mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 17:25:59 +02:00
Rename archive components
This commit is contained in:
+4
-4
@@ -9,7 +9,7 @@ import { humanize } from "../../utils"
|
||||
import { Sidebar } from "../Sidebar"
|
||||
import * as SC from "./styles"
|
||||
|
||||
const ALL_ARCHIVES = graphql`
|
||||
const ALL_SPOTLIGHTS = graphql`
|
||||
query {
|
||||
spotlights: allFile(
|
||||
filter: { sourceInstanceName: { eq: "spotlights" } }
|
||||
@@ -42,9 +42,9 @@ function Tree({ item }: { item: IFileOrFolder }) {
|
||||
)
|
||||
}
|
||||
|
||||
export const ArchivesSidebar: FC<HTMLAttributes<HTMLDivElement>> = (props) => {
|
||||
const { archives } = useStaticQuery(ALL_ARCHIVES)
|
||||
const tree = useBuildTree(archives, "/spotlights")
|
||||
export const SpotlightsSidebar: FC<HTMLAttributes<HTMLDivElement>> = (props) => {
|
||||
const { spotlights } = useStaticQuery(ALL_SPOTLIGHTS)
|
||||
const tree = useBuildTree(spotlights, "/spotlights")
|
||||
const sortedTree = sort((a, b) => a.title.localeCompare(b.title), tree)
|
||||
|
||||
return (
|
||||
@@ -1,13 +1,13 @@
|
||||
import React, { FC } from "react"
|
||||
|
||||
import { ArchivesSidebar } from "../../components/ArchivesSidebar"
|
||||
import { SpotlightsSidebar } from "../../components/SpotlightsSidebar"
|
||||
import { ColumnLayout } from "../ColumnLayout"
|
||||
|
||||
export const ArchivesLayout: FC = ({ children }) => {
|
||||
export const SpotlightsLayout: FC = ({ children }) => {
|
||||
return (
|
||||
<ColumnLayout
|
||||
title="Spotlights"
|
||||
sidebar={ArchivesSidebar}
|
||||
sidebar={SpotlightsSidebar}
|
||||
content={children}
|
||||
/>
|
||||
)
|
||||
@@ -1,7 +1,7 @@
|
||||
import { WindowLocation } from "@reach/router"
|
||||
import React, { FC, useMemo } from "react"
|
||||
import { LocationProvider } from "../LocationProvider"
|
||||
import { ArchivesLayout } from "./ArchivesLayout"
|
||||
import { SpotlightsLayout } from "./SpotlightsLayout"
|
||||
import { HomeLayout } from "./HomeLayout"
|
||||
import { PageLayout } from "./PageLayout"
|
||||
import { ResourcesLayout } from "./ResourcesLayout"
|
||||
@@ -22,7 +22,7 @@ const BaseLayout: FC<IBaseLayout> = (props) => {
|
||||
case "resources":
|
||||
return ResourcesLayout
|
||||
case "spotlights":
|
||||
return ArchivesLayout
|
||||
return SpotlightsLayout
|
||||
case "regular":
|
||||
return PageLayout
|
||||
default:
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Link } from "../../components/Link"
|
||||
import { PageContent } from "../../components/PageContent"
|
||||
import { SEO } from "../../components/SEO"
|
||||
|
||||
function ArchivesPage() {
|
||||
function SpotlightsPage() {
|
||||
return (
|
||||
<Fragment>
|
||||
<SEO title="Tech Spotlights" />
|
||||
@@ -25,4 +25,4 @@ function ArchivesPage() {
|
||||
)
|
||||
}
|
||||
|
||||
export default ArchivesPage
|
||||
export default SpotlightsPage
|
||||
@@ -7,7 +7,7 @@ import { humanize } from "../utils"
|
||||
import { PageContent } from "../components/PageContent"
|
||||
|
||||
// @todo maybe find alternative type for data
|
||||
const Archive: FC<any> = ({ data }) => {
|
||||
const Spotlight: FC<any> = ({ data }) => {
|
||||
const { relativePath } = data.file
|
||||
const { body, excerpt, fields, timeToRead, frontmatter } = data.file.post
|
||||
|
||||
@@ -30,10 +30,10 @@ const Archive: FC<any> = ({ data }) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default Archive
|
||||
export default Spotlight
|
||||
|
||||
export const query = graphql`
|
||||
query Archive($file: String!) {
|
||||
query Spotlight($file: String!) {
|
||||
file(relativePath: { eq: $file }) {
|
||||
relativePath
|
||||
post: childMdx {
|
||||
Vendored
+3
-3
@@ -32,7 +32,7 @@ export interface IFileResourceQuery {
|
||||
}
|
||||
}
|
||||
|
||||
export interface IFileArchiveQuery {
|
||||
export interface IFileSpotlightQuery {
|
||||
node: {
|
||||
relativePath: string
|
||||
}
|
||||
@@ -50,9 +50,9 @@ export interface IAllResourcesQuery extends IAllFilesQuery {
|
||||
}
|
||||
}
|
||||
|
||||
export interface IAllArchivesQuery extends IAllFilesQuery {
|
||||
export interface IAllSpotlightsQuery extends IAllFilesQuery {
|
||||
allFile: {
|
||||
edges: IFileArchiveQuery[]
|
||||
edges: IFileSpotlightQuery[]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user