Skip to content

Commit

Permalink
Simplified table of an Apps SDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
ddxv committed Jan 20, 2025
1 parent ccbad5d commit 1479286
Showing 1 changed file with 21 additions and 28 deletions.
49 changes: 21 additions & 28 deletions frontend/src/lib/AppSDKOverview.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import ManifestItemList from '$lib/ManifestItemList.svelte';
import WhiteCard from '$lib/WhiteCard.svelte';
import RequestSDKScanButton from '$lib/RequestSDKScanButton.svelte';
import CompanyButton from '$lib/CompanyButton.svelte';
import { page } from '$app/state';
Expand All @@ -22,42 +22,35 @@
{:then packageInfo}
{#if typeof packageInfo == 'string'}
<p>Permissions, SDKs and trackers info not yet available for this app.</p>
{:else}
{#if packageInfo.sdk_categories && Object.keys(packageInfo.sdk_categories).length > 0}
{#await companyTypes}
Loading company types...
{:then myCompanyTypes}
<RequestSDKScanButton />
{:else if packageInfo.sdk_categories && Object.keys(packageInfo.sdk_categories).length > 0}
{#await companyTypes}
Loading company types...
{:then myCompanyTypes}
<div class="grid grid-cols-1 md:grid-cols-2 gap-2">
{#each Object.keys(packageInfo.sdk_categories) as category}
<WhiteCard>
{#snippet title()}
{myCompanyTypes.types.find((x: { url_slug: string }) => x.url_slug === category)
?.name || category}
{/snippet}
<div class="p-2">
<ManifestItemList items={packageInfo.sdk_categories[category]}></ManifestItemList>
<div class="grid grid-cols-1 md:grid-cols-2 gap-2 p-4">
{#each packageInfo.sdk_categories[category] as company}
<CompanyButton
companyName={company.company_name}
companyDomain={company.company_domain}
/>
{/each}
</div>
</WhiteCard>
{/each}
{/await}
{:else}
<p>
No SDKs found for this app, <a href="/apps/{page.params.id}/sdks"
>check the full list of SDKs
</a> for untagged companies.
</p>
{/if}
{#if packageInfo.permissions && packageInfo.permissions.length > 0}
<h4 class="h4 md:h3 p-2 md:p-4 mt-4">Permissions</h4>
<div class="px-4 md:px-8 max-w-sm md:max-w-md lg:max-w-full overflow-x-scroll">
{#each packageInfo.permissions as permission}
<p>{permission}</p>
{/each}
</div>
{/if}
{#if packageInfo.leftovers && Object.keys(packageInfo.leftovers).length > 0}
<h4 class="h4 md:h3 p-2 md:p-4 mt-4">Unknown SDKs and Services</h4>
<ManifestItemList items={packageInfo.leftovers}></ManifestItemList>
{/if}
{/await}
{:else}
<p>
No SDKs found for this app, <a href="/apps/{page.params.id}/sdks"
>check the full list of SDKs
</a> for untagged companies.
</p>
{/if}
{/await}
<RequestSDKScanButton />

0 comments on commit 1479286

Please sign in to comment.