Merge pull request #752 from afrieirham/feat/sort-integrations-alphabetically

feat: sort cloud and framework integrations alphabetically
This commit is contained in:
Akhil Mohan
2023-07-16 14:34:26 +05:30
committed by GitHub
2 changed files with 6 additions and 2 deletions

View File

@@ -31,6 +31,8 @@ export const CloudIntegrationSection = ({
const isEmpty = !isLoading && !cloudIntegrations?.length; const isEmpty = !isLoading && !cloudIntegrations?.length;
const sortedCloudIntegrations = cloudIntegrations.sort((a, b) => a.name.localeCompare(b.name));
return ( return (
<div> <div>
<div className="m-4 mt-7 flex max-w-5xl flex-col items-start justify-between px-2 text-xl"> <div className="m-4 mt-7 flex max-w-5xl flex-col items-start justify-between px-2 text-xl">
@@ -43,7 +45,7 @@ export const CloudIntegrationSection = ({
<Skeleton className="h-32" key={`cloud-integration-skeleton-${index + 1}`} /> <Skeleton className="h-32" key={`cloud-integration-skeleton-${index + 1}`} />
))} ))}
{!isLoading && {!isLoading &&
cloudIntegrations?.map((cloudIntegration) => ( sortedCloudIntegrations?.map((cloudIntegration) => (
<div <div
onKeyDown={() => null} onKeyDown={() => null}
role="button" role="button"

View File

@@ -12,6 +12,8 @@ type Props = {
export const FrameworkIntegrationSection = ({ frameworks }: Props) => { export const FrameworkIntegrationSection = ({ frameworks }: Props) => {
const { t } = useTranslation(); const { t } = useTranslation();
const sortedFrameworks = frameworks.sort((a, b) => a.name.localeCompare(b.name));
return ( return (
<> <>
<div className="mx-4 mt-12 mb-4 flex flex-col items-start justify-between px-2 text-xl"> <div className="mx-4 mt-12 mb-4 flex flex-col items-start justify-between px-2 text-xl">
@@ -22,7 +24,7 @@ export const FrameworkIntegrationSection = ({ frameworks }: Props) => {
className="mx-6 mt-4 grid grid-flow-dense gap-3" className="mx-6 mt-4 grid grid-flow-dense gap-3"
style={{ gridTemplateColumns: "repeat(auto-fill, minmax(120px, 1fr))" }} style={{ gridTemplateColumns: "repeat(auto-fill, minmax(120px, 1fr))" }}
> >
{frameworks.map((framework) => ( {sortedFrameworks.map((framework) => (
<a <a
key={`framework-integration-${framework.slug}`} key={`framework-integration-${framework.slug}`}
href={framework.docsLink} href={framework.docsLink}