-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: refactor the advanced resources and basic resources and case study components * feat: add good styling * feat: add case study detail highlight * chore: cleanup & add seo details --------- Co-authored-by: Yannick Musafiri <musayann@gmail.com>
- Loading branch information
1 parent
2cdcd9d
commit 85c1f60
Showing
18 changed files
with
312 additions
and
178 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { NextSeoProps } from "next-seo" | ||
export default { | ||
title: "CoDesignSytemsMap", | ||
description: | ||
"A map of design systems and their components, patterns, and tools.", | ||
} as NextSeoProps |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,28 +1,37 @@ | ||
import { Group } from "@/types/interfaces"; | ||
import Block from "./Block"; | ||
|
||
const AdvancedResources = ({ data }: { data: Group }) => { | ||
return ( | ||
<div> | ||
<h3 className="text-gray-600 font-semibold text-center text-2xl my-10"> | ||
{data.title != "NO GROUP" && data.title} | ||
</h3> | ||
<div className="flex justify-center w-full"> | ||
<div className={`p-4 grid grid-cols-8 grid-flow-col justify-center gap-3 text-sm w-full`}> | ||
{data.blocks.map((block, i) => { | ||
return ( | ||
<Block | ||
key={`${data.title}-${block.title}-${i}`} | ||
title={block.title} | ||
description={block.description} | ||
entries={block.entries} | ||
/> | ||
); | ||
})} | ||
</div> | ||
</div> | ||
const AdvancedResources = ({ | ||
data, | ||
minifiedHeader | ||
}: { | ||
data: Group; | ||
minifiedHeader?: boolean; | ||
}) => { | ||
return ( | ||
<> | ||
<h3 className="text-gray-600 font-semibold text-center text-2xl my-10"> | ||
{data.title != "NO GROUP" && data.title} | ||
</h3> | ||
<div className="flex w-full"> | ||
<div | ||
className={`p-4 grid grid-cols-8 grid-flow-col justify-center gap-3 text-sm w-full`} | ||
> | ||
{data.blocks.map((block, i) => { | ||
return ( | ||
<Block | ||
key={`${data.title}-${block.title}-${i}`} | ||
title={block.title} | ||
description={block.description} | ||
entries={block.entries} | ||
minifiedHeader={minifiedHeader} | ||
/> | ||
); | ||
})} | ||
</div> | ||
); | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default AdvancedResources; |
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React from "react"; | ||
import ArrowDown from "./icons/ArrowDown"; | ||
|
||
interface Props { | ||
levels: string[]; | ||
technologies: string[]; | ||
} | ||
|
||
const buttonBlock = (entries: string[], title: string, style: string) => ( | ||
<div> | ||
<h1 className="text-center text-gray-500 text-xl font-bold mb-3"> | ||
{title} | ||
</h1> | ||
|
||
<div className="flex flex-col gap-2 p-4 h-72 overflow-y-auto"> | ||
{entries.map((element, index) => ( | ||
<button | ||
key={index} | ||
className={`border border-gray-500 p-4 rounded-lg ${style}`} | ||
> | ||
{element} | ||
</button> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
|
||
const HightlightCaseStudyDetails = ({ levels, technologies }: Props) => { | ||
return ( | ||
<div className="flex items-center flex-col"> | ||
<ArrowDown /> | ||
<h1 className="text-center text-gray-500 text-xl font-bold mb-3 "> | ||
Hightlight Case Study Details | ||
</h1> | ||
<div className="bg-gray-200 rounded-2xl flex gap-2 py-4 px-8 border border-gray-500"> | ||
<div className="p-4"> | ||
<div> | ||
{buttonBlock( | ||
levels, | ||
"Case Study Implementation Level", | ||
"bg-black-900 text-white" | ||
)} | ||
</div> | ||
</div> | ||
<div className="p-4"> | ||
{buttonBlock( | ||
technologies, | ||
"Case Study Technology", | ||
"bg-white text-black" | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default HightlightCaseStudyDetails; |
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
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,49 +1,54 @@ | ||
import { Handle, Position } from "reactflow"; | ||
import "reactflow/dist/style.css"; | ||
import Star from "@/components/icons/Star"; | ||
import classNames from "classnames"; | ||
import { getColorByAccess } from "@/utils/helpers"; | ||
import { getBgColor, getColorByAccess } from "@/utils/helpers"; | ||
import Link from "next/link"; | ||
|
||
export function NodeCard({ data, id, isToolsBlock = false }: any) { | ||
id = data.Key; | ||
const level = Array.isArray(data.PARSED_MANUAL_TAGS?.CO_DESIGN_LEVEL) | ||
? data.PARSED_MANUAL_TAGS?.CO_DESIGN_LEVEL[0] | ||
: data.PARSED_MANUAL_TAGS?.CO_DESIGN_LEVEL; | ||
const bgColor = classNames({ | ||
"bg-level-primary-0 border-level-secondary-0": level == 0, | ||
"bg-level-primary-1 border-level-secondary-1": level == 1, | ||
"bg-level-primary-2 border-level-secondary-2": level == 2, | ||
"bg-level-primary-3 border-level-secondary-3": level == 3, | ||
}); | ||
const dataAccess = data.PARSED_MANUAL_TAGS.ACCESS; | ||
export function NodeCard({ data }: any) { | ||
const bgColor = getBgColor(data); | ||
const dataAccess = data?.PARSED_MANUAL_TAGS?.ACCESS?.[0]; | ||
const starColor = getColorByAccess(dataAccess); | ||
const summary = data.Notes?.replace(/<[^>]*>?/gm, ''); | ||
const summary = data.Notes?.replace(/<[^>]*>?/gm, ""); | ||
|
||
return ( | ||
<div className="group cursor-pointer"> | ||
<Handle type="target" position={Position.Top} id={id} /> | ||
<div | ||
className={`py-4 px-2 text-xs w-52 rounded-md border-solid border-2 hover:border-4 box-content hover:relative hover:border-purple-500 ${bgColor}`} | ||
> | ||
<div className="relative "> | ||
<p className="z-10">{data.Title}</p> | ||
{dataAccess === "Institutional Access" || | ||
dataAccess === "Paid Service" || | ||
dataAccess === "Open Source" ? ( | ||
<div className="absolute -bottom-5 -right-5"> | ||
<Star color={starColor} /> | ||
<Handle type="target" position={Position.Top} id={data.Key} /> | ||
<Link href={data?.Url} target="_blank"> | ||
<div | ||
className={`py-4 px-2 text-xs w-52 rounded-md border-solid border-2 hover:border-4 box-content hover:relative hover:border-purple-500 ${bgColor}`} | ||
> | ||
<div className="relative"> | ||
<p className="z-10">{data.Title}</p> | ||
<p className="z-10">{data.Author}</p> | ||
{(dataAccess === "Institutional Access" || | ||
dataAccess === "Paid Service" || | ||
dataAccess === "Open Source") && ( | ||
<div className="absolute -bottom-9 -right-7"> | ||
<Star color={starColor} /> | ||
</div> | ||
)} | ||
<div className="absolute hidden group-hover:block bg-white border p-4 mt-2 z-20"> | ||
<p> | ||
<strong>Author</strong>: {data.Author} | ||
</p> | ||
{summary && ( | ||
<div> | ||
<strong>Summary</strong>: {summary} | ||
</div> | ||
)} | ||
<p> | ||
<strong>Title</strong>: {data.Title} | ||
</p> | ||
<p> | ||
<strong>Tags</strong>: {data.Manual_Tags} | ||
</p> | ||
</div> | ||
) : ( | ||
"" | ||
)} | ||
<div className="absolute hidden group-hover:block bg-white border p-4 mt-2 z-20"> | ||
<p><strong>Author</strong>: {data.Author}</p> | ||
{summary && (<div><strong>Summary</strong>: {summary}</div>)} | ||
<p><strong>Title</strong>: {data.Title}</p> | ||
<p><strong>Tags</strong>: {data.Manual_Tags}</p> | ||
</div> | ||
</div> | ||
</div> | ||
<Handle type="source" position={Position.Bottom} id={id} /> | ||
</Link> | ||
|
||
<Handle type="source" position={Position.Bottom} id={data.Key} /> | ||
</div> | ||
); | ||
} | ||
13579; |
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 output from "../../../public/data.json"; | ||
|
||
const rawLevels = output.map((data) => data?.PARSED_MANUAL_TAGS['CASE STUDY THEME']).flat().filter((theme) => theme) as string[] | ||
const rawLevels = output.map((data) => data?.PARSED_MANUAL_TAGS['CASE STUDY LEVEL']).flat().filter((theme) => theme) as string[] | ||
|
||
export const levels = Array.from(new Set(rawLevels)); |
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,8 @@ | ||
import output from "../../../public/data.json"; | ||
|
||
const rawTechnlogies = output.map((data) => data?.PARSED_MANUAL_TAGS['CASE STUDY TECH']).flat().filter((theme) => theme) as string[] | ||
const rawTechnlogies = output | ||
.map((data) => data?.PARSED_MANUAL_TAGS["CASE STUDY TECH"]) | ||
.flat() | ||
.filter((theme) => theme) as string[]; | ||
|
||
export const technlogies = Array.from(new Set(rawTechnlogies)); | ||
export const technologies = Array.from(new Set(rawTechnlogies)); |
Oops, something went wrong.