Skip to content

Commit

Permalink
[#315,ecosystem/cohere][s]: hack a bit to get directory listing working.
Browse files Browse the repository at this point in the history
⚠️ More work needed!
  • Loading branch information
rufuspollock committed Jun 7, 2024
1 parent 7c10601 commit a2dfc2c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion components/custom/OrgList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function OrgList({ orgs }) {
<div key={org.id} className="group relative">
<div className="w-full aspect-square bg-beige rounded-md overflow-hidden group-hover:opacity-75">
<img
src={(org.logo.cached_new || org.logo.url) ?? (org.image.cached_new || org.image.url)}
src={(org.logo?.cached_new || org.logo?.url) ?? (org.image?.cached_new || org.image.url || org.image)}
alt={org.title}
className="w-full h-full m-0 object-contain"
/>
Expand Down
2 changes: 1 addition & 1 deletion components/custom/ProfileSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function ProfileSearch({ profiles }) {
const aggregations = {};
for (const f of facets) {
aggregations[f.id] = {
title: f.name,
title: f.name || f.title, // hack to support cohere and pip. cohere does not have name
size: 20, // set to 20 to be bigger than max size of a facet atm
conjunction: true // not sure why
};
Expand Down
17 changes: 5 additions & 12 deletions pages/ecosystem/cohere.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ import { hasRequiredProfileFields } from "@/lib/temp/hasRequiredProfileFields";

interface Props extends CustomAppProps {
profiles: any; // TODO: type
topics: any; // TODO: type
}

const HomePage: React.FC<Props> = ({ profiles, topics }) => {
const HomePage: React.FC<Props> = ({ profiles }) => {
return (
<>
<div className="prose mx-auto max-w-xl">
Expand Down Expand Up @@ -46,19 +45,14 @@ export const getStaticProps: GetStaticProps = async (): Promise<
acc.push({
...file.metadata,
image: file.metadata.image?.url ?? file.metadata.image,
topic: file.metadata.sectors,
activity: file.metadata.activities,
id: file.metadata.title.toLowerCase(),
urlPath: '/' + file.url_path,
});
return acc;
}, []);

const topicFiles = await mddb.getFiles({ folder: "topics" });
const topics = topicFiles.map((file) => {
return {
...file.metadata,
urlPath: file.url_path,
};
});

return {
props: {
meta: {
Expand All @@ -68,8 +62,7 @@ export const getStaticProps: GetStaticProps = async (): Promise<
showSidebar: false,
showComments: false,
},
profiles,
topics,
profiles
},
};
};
Expand Down

0 comments on commit a2dfc2c

Please sign in to comment.