Skip to content

Commit

Permalink
Merge pull request #86 from adastackio/os_builders
Browse files Browse the repository at this point in the history
Add Documentation page, improve and reorganize many pages
  • Loading branch information
adastackio authored Jan 1, 2025
2 parents 8ed024e + 02c35fe commit f443141
Show file tree
Hide file tree
Showing 105 changed files with 3,772 additions and 3,090 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ pnpm-lock.yaml
.env
.vercel
.env*.local
.aider*
data/
.vscode/settings.json

2 changes: 1 addition & 1 deletion assets/icons/oss.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions components/LibraryInfo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React from "react";
import RepoShieldIo from "./badges/shield_io_badges/RepoShieldIo";
import LanguageShieldIo from "./badges/shield_io_badges/LanguageShieldIo";
import LatestCommitShieldIo from "./badges/shield_io_badges/LatestCommitShieldIo";
import DiscordShieldIo from "./badges/shield_io_badges/DiscordShieldIo";
import DocsShieldIo from "./badges/shield_io_badges/DocsShieldIo";

interface DiscordInfo {
discordInviteURL: string;
DiscordServerName: string;
}

interface LibraryInfoProps {
repoURL: string;
language: string;
docsURL: string;
discord: DiscordInfo[];
}

const LibraryInfo: React.FC<LibraryInfoProps> = ({
repoURL,
language,
discord,
docsURL,
}) => {
return (
<div className="code-library-info-bar flex gap-2 items-center pb-5">
{language && (
<LanguageShieldIo language={language} isColorChanging={false} />
)}
{docsURL && <DocsShieldIo docsURL={docsURL} />}

{discord &&
discord.length > 0 &&
discord.map((info, index) => (
<DiscordShieldIo
key={index}
discordInviteURL={info.discordInviteURL}
DiscordServerName={info.DiscordServerName}
/>
))}
{repoURL && <LatestCommitShieldIo repoURL={repoURL} />}
{repoURL && <RepoShieldIo repoURL={repoURL} />}
</div>
);
};

export default LibraryInfo;
21 changes: 0 additions & 21 deletions components/LibraryInfoBar.tsx

This file was deleted.

37 changes: 37 additions & 0 deletions components/badges/shield_io_badges/DiscordShieldIo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from "react";

interface DiscordShieldIoProps {
discordInviteURL?: string;
DiscordServerName?: string;
}

const DiscordShieldIo: React.FC<DiscordShieldIoProps> = ({
discordInviteURL,
DiscordServerName = "Discord",
}) => {
if (!discordInviteURL) {
return null;
}

// Replace dashes with HTML entity for en dash
const formattedChannelName = DiscordServerName.replace(/-/g, "–");

return (
<a
href={discordInviteURL}
className="inline-block"
target="_blank"
rel="noopener noreferrer"
>
<img
className="shield_io_badge badge-io-custom-shading shields_io_repo_badge"
alt={`${DiscordServerName} Discord`}
src={`https://img.shields.io/badge/${encodeURIComponent(
formattedChannelName
)}-ffffff?style=flat&logo=discord&logoColor=7289DA&labelColor=dfe8f0`}
/>
</a>
);
};

export default DiscordShieldIo;
24 changes: 24 additions & 0 deletions components/badges/shield_io_badges/DocsShieldIo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from "react";

interface DocsShieldIoProps {
docsURL: string;
}

const DocsShieldIo = ({ docsURL }: DocsShieldIoProps) => {
return (
<a
className="inline-block"
target="_blank"
rel="noopener noreferrer"
href={docsURL}
>
<img
src="https://img.shields.io/badge/-Docs-white?logo=readme&labelColor=white&logoColor=61a6fa"
className="shield_io_badge badge-io-custom-shading shields_io_repo_badge"
alt="Latest Commit"
/>
</a>
);
};

export default DocsShieldIo;
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
import React from "react";

interface LatestCommitBadgeIoProps {
interface LatestCommitShieldIoProps {
repoURL: string;
}

const LatestCommitBadgeIo = ({ repoURL }: LatestCommitBadgeIoProps) => {
const LatestCommitShieldIo = ({ repoURL }: LatestCommitShieldIoProps) => {
const url = new URL(repoURL);
const cleanPath = url.pathname.replace(/\/+$/, "");
const pathSegments = cleanPath.split("/").filter(Boolean);
const [owner, repo] = pathSegments;

const isGitLab = url.hostname === "gitlab.com";


const latestURL = isGitLab
? `${url.origin}/${owner}/${repo}/-/commits/`
: `${url.origin}/${owner}/${repo}/commits/`;


const shieldUrl = isGitLab
? `https://img.shields.io/gitlab/last-commit/${owner}/${repo}?color=dfe8f0&labelColor=white`
: `https://img.shields.io/github/last-commit/${owner}/${repo}?color=dfe8f0&labelColor=white`;
? `https://img.shields.io/gitlab/last-commit/${owner}/${repo}?color=white&labelColor=dfe8f0`
: `https://img.shields.io/github/last-commit/${owner}/${repo}?color=white&labelColor=dfe8f0`;

return (
<a className="inline-block" href={latestURL}>
<a
className="inline-block"
target="_blank"
rel="noopener noreferrer"
href={latestURL}
>
<img
src={shieldUrl}
className="shield_io_badge badge-io-custom-shading shields_io_repo_badge"
Expand All @@ -33,4 +36,4 @@ const LatestCommitBadgeIo = ({ repoURL }: LatestCommitBadgeIoProps) => {
);
};

export default LatestCommitBadgeIo;
export default LatestCommitShieldIo;
2 changes: 1 addition & 1 deletion components/badges/shield_io_badges/RepoShieldIo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const RepoShieldIo = ({ repoURL }: RepoShieldIoProps) => {
: `https://img.shields.io/github/stars/${owner}/${repo}?style=social&label=GitHub`;

return (
<a className="inline-block" href={repoURL}>
<a className="inline-block" target="_blank" rel="noopener noreferrer" href={repoURL}>
<img
src={shieldUrl}
className="shield_io_badge shields_io_repo_badge"
Expand Down
17 changes: 10 additions & 7 deletions components/tables/OpenSourceBuildersTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ const OpenSourceBuildersTable = ({ data }) => {
"Organization",
"dApp",
"Audits",
"Dev Company",
"dev_company",
"Tools",
];

Expand Down Expand Up @@ -319,23 +319,23 @@ const OpenSourceBuildersTable = ({ data }) => {
filters: [
{
text: "Organization",
value: "Organization",
value: "organization",
},
{
text: "Dapp",
value: "dApp",
value: "dapp",
},
{
text: "Dev Company",
value: "Dev Company",
value: "dev_company",
},
{
text: "Audits",
value: "Audits",
value: "audits",
},
{
text: "Tools",
value: "Tools",
value: "tools",
},
],
filterMode: "tree",
Expand Down Expand Up @@ -369,7 +369,10 @@ const OpenSourceBuildersTable = ({ data }) => {
}
return (
<>
<CategoryTag color={color} category={tag.toUpperCase()} />
<CategoryTag
color={color}
category={tag.replace(/_/g, " ").toUpperCase()}
/>
</>
);
})}
Expand Down
Loading

1 comment on commit f443141

@vercel
Copy link

@vercel vercel bot commented on f443141 Jan 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.