-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac52cc2
commit 45267c7
Showing
12 changed files
with
636 additions
and
635 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import onPreInit from "./gatsby/onPreInit"; | ||
import createSchemaCustomization from "./gatsby/createSchemeCustomization"; | ||
import createPages from "./gatsby/createPages"; | ||
// import createPages from "./gatsby/createPages"; | ||
|
||
export { createPages, onPreInit, createSchemaCustomization }; | ||
export { onPreInit, createSchemaCustomization }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,64 @@ | ||
import React from "react"; | ||
import { PageRendererProps, graphql, useStaticQuery } from "gatsby"; | ||
// import React from "react"; | ||
// import { PageRendererProps, graphql, useStaticQuery } from "gatsby"; | ||
|
||
import ComponentsList from "./components/ComponentList"; | ||
import DocLayout from "../DocLayout"; | ||
import { SchemeTrackingNode } from "./interfaces"; | ||
// import ComponentsList from "./components/ComponentList"; | ||
// import DocLayout from "../DocLayout"; | ||
// import { SchemeTrackingNode } from "./interfaces"; | ||
|
||
const AllRepositories = ({ location }: PageRendererProps) => { | ||
const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql` | ||
query AllRepositoriesTracking { | ||
# get only the latest | ||
allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) { | ||
nodes { | ||
createdAt | ||
trackedData { | ||
instances | ||
category | ||
icon | ||
isDeprecated | ||
name | ||
} | ||
} | ||
} | ||
} | ||
`); | ||
// const AllRepositories = ({ location }: PageRendererProps) => { | ||
// const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql` | ||
// query AllRepositoriesTracking { | ||
// # get only the latest | ||
// allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) { | ||
// nodes { | ||
// createdAt | ||
// trackedData { | ||
// instances | ||
// category | ||
// icon | ||
// isDeprecated | ||
// name | ||
// } | ||
// } | ||
// } | ||
// } | ||
// `); | ||
|
||
const components = allTracking.nodes.reduce((acc, cur) => { | ||
cur.trackedData | ||
.filter(source => !source.icon) | ||
.forEach(({ name, instances, category, isDeprecated }) => { | ||
if (!acc[name]) { | ||
acc[name] = { | ||
name, | ||
instances, | ||
category, | ||
isDeprecated, | ||
slug: `/dashboard/tracking/allrepositories/${name.toLowerCase()}`, | ||
}; | ||
} else { | ||
const prev = acc[name]; | ||
// const components = allTracking.nodes.reduce((acc, cur) => { | ||
// cur.trackedData | ||
// .filter(source => !source.icon) | ||
// .forEach(({ name, instances, category, isDeprecated }) => { | ||
// if (!acc[name]) { | ||
// acc[name] = { | ||
// name, | ||
// instances, | ||
// category, | ||
// isDeprecated, | ||
// slug: `/dashboard/tracking/allrepositories/${name.toLowerCase()}`, | ||
// }; | ||
// } else { | ||
// const prev = acc[name]; | ||
|
||
acc[name] = { | ||
...acc[name], | ||
instances: prev.instances + instances, | ||
}; | ||
} | ||
}); | ||
// acc[name] = { | ||
// ...acc[name], | ||
// instances: prev.instances + instances, | ||
// }; | ||
// } | ||
// }); | ||
|
||
return acc; | ||
}, []); | ||
// return acc; | ||
// }, []); | ||
|
||
return ( | ||
<DocLayout | ||
location={location} | ||
path="/dashboard/tracking/allrepositories/" | ||
title="All Repositories" | ||
noElevation | ||
> | ||
<ComponentsList components={Object.values(components)} /> | ||
</DocLayout> | ||
); | ||
}; | ||
// return ( | ||
// <DocLayout | ||
// location={location} | ||
// path="/dashboard/tracking/allrepositories/" | ||
// title="All Repositories" | ||
// noElevation | ||
// > | ||
// <ComponentsList components={Object.values(components)} /> | ||
// </DocLayout> | ||
// ); | ||
// }; | ||
|
||
export default AllRepositories; | ||
// export default AllRepositories; |
Oops, something went wrong.