Skip to content

Commit dd0d555

Browse files
committed
Only show API calls tab for android
1 parent 948957b commit dd0d555

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

frontend/src/lib/utils/AppTabs.svelte

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<script lang="ts">
22
import { page } from '$app/state';
3-
import { ChartLine, ChartBar, Boxes, Key, TrendingUp, FileText, Cog } from 'lucide-svelte';
3+
import { ChartLine, ChartBar, Boxes, Key, TrendingUp, FileText } from 'lucide-svelte';
4+
5+
let { isAndroidApp } = $props();
46
57
let myTabs = {
68
types: [
@@ -29,11 +31,16 @@
2931
url_slug: 'ranks',
3032
icon: ChartBar
3133
},
32-
{
33-
name: 'Data & API Calls',
34-
url_slug: 'data-flows',
35-
icon: FileText
36-
},
34+
...(isAndroidApp
35+
? [
36+
{
37+
name: 'Data & API Calls',
38+
url_slug: 'data-flows',
39+
icon: FileText
40+
}
41+
]
42+
: []),
43+
3744
{
3845
name: 'App-Ads.txt',
3946
url_slug: 'ads-txt',

frontend/src/routes/apps/[id]/+layout.svelte

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,31 @@
33
import RatingInstallsLarge from '$lib/RatingInstallsLarge.svelte';
44
import StarsRating from '$lib/StarsRating.svelte';
55
import WhiteCard from '$lib/WhiteCard.svelte';
6-
let { data, children } = $props();
6+
import type { AppSDKsOverview, CompanyTypes, AppFullDetail, CatData } from '../../../types';
7+
let {
8+
data,
9+
children
10+
}: {
11+
data: {
12+
myapp: AppFullDetail;
13+
appSDKsOverview: AppSDKsOverview;
14+
companyTypes: CompanyTypes;
15+
appCats: CatData;
16+
};
17+
children: any;
18+
} = $props();
19+
720
import AvailableOniOs from '$lib/svg/AvailableOniOS.svelte';
821
import AppSDKOverview from '$lib/AppSDKOverview.svelte';
922
1023
import AppTabs from '$lib/utils/AppTabs.svelte';
1124
25+
function isAndroid() {
26+
return /^\d+$/.test(page.params.id);
27+
}
28+
29+
let isAndroidApp = $derived(isAndroid());
30+
1231
function getCategoryName(category: string) {
1332
if (category) {
1433
return (
@@ -195,7 +214,7 @@
195214

196215
<nav class="bg-surface-100-800-token border-y border-surface-300-600-token my-2 md:my-6">
197216
<div class="mx-1: md:mx-8">
198-
<AppTabs />
217+
<AppTabs {isAndroidApp} />
199218
</div>
200219
</nav>
201220

frontend/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export interface CategoryInfo {
118118
}
119119

120120
export interface CatData {
121-
categories: Record<string, CategoryInfo>;
121+
categories: Array<{ id: string; name: string }>;
122122
}
123123

124124
export interface CategoriesInfo {

0 commit comments

Comments
 (0)