Skip to content

Commit

Permalink
Setup analytics for Web3Hub (#7666)
Browse files Browse the repository at this point in the history
* feat: add track screens on Web3Hub
  • Loading branch information
RamyEB committed Sep 3, 2024
1 parent f0721f2 commit 32b33b6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-walls-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": patch
---

Setup analytics on Web3Hub
3 changes: 1 addition & 2 deletions apps/ledger-live-mobile/src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -6919,8 +6919,7 @@
"placeholder": "Search or type a URL"
},
"clearSigning": {
"title": "Clear signing",
"description": "Clear signing allows you to sign a message without revealing the content of the message to the app. This is useful for privacy and security reasons."
"title": "Clear signing"
}
},
"app": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import WebPlatformPlayer from "./components/Web3Player";
import GenericErrorView from "~/components/GenericErrorView";
import useWeb3HubAppViewModel from "./useWeb3HubAppViewModel";
import Header, { TOTAL_HEADER_HEIGHT } from "./components/Header";
import { TrackScreen } from "~/analytics";

const appManifestNotFoundError = new Error("App not found");

Expand All @@ -29,6 +30,7 @@ export default function Web3HubApp({ navigation, route }: AppProps) {

return (
<SafeAreaView edges={edges} style={{ flex: 1 }}>
<TrackScreen category="Web3Hub" page="App" appId={manifest?.id} />
<Header
navigation={navigation}
layoutY={layoutY}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ type Props = {
title: string;
categoryId: string;
navigation: MainProps["navigation"];
testID?: string;
};

const ManifestsCategoryList = ({ title, categoryId, navigation }: Props) => {
const ManifestsCategoryList = ({ title, categoryId, navigation, testID }: Props) => {
const { data, isLoading, onEndReached } = useManifestsListViewModel(categoryId);

const goToApp = useCallback(
Expand All @@ -37,7 +38,7 @@ const ManifestsCategoryList = ({ title, categoryId, navigation }: Props) => {
onPressItem={disclaimer.onPressItem}
isLoading={isLoading}
onEndReached={onEndReached}
testID="web3hub-clear-signing-scroll"
testID={testID}
/>
</>
) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { MAIN_BUTTON_BOTTOM, MAIN_BUTTON_SIZE } from "~/components/TabBar/shared
import Header, { ANIMATION_HEIGHT, TOTAL_HEADER_HEIGHT } from "./components/Header";
import ManifestsCategoryList from "./components/ManifestsCategoryList";
import { Text } from "@ledgerhq/native-ui";
import { TrackScreen } from "~/analytics";

const PADDING_BOTTOM = MAIN_BUTTON_SIZE + MAIN_BUTTON_BOTTOM;

Expand All @@ -20,6 +21,8 @@ export default function Web3HubMain({ navigation }: MainProps) {

return (
<SafeAreaView edges={edges} style={{ flex: 1 }}>
<TrackScreen category="Web3Hub" page="Main" />

<Header title={t("web3hub.main.header.title")} navigation={navigation} layoutY={layoutY} />

<View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ManifestsList from "LLM/features/Web3Hub/components/ManifestsList";
import SearchList from "./components/SearchList";
import Header, { TOTAL_HEADER_HEIGHT } from "./components/Header";
import { Text } from "@ledgerhq/native-ui";
import { TrackScreen } from "~/analytics";

const edges = ["top", "bottom", "left", "right"] as const;

Expand All @@ -23,6 +24,7 @@ export default function Web3HubSearch({ navigation }: SearchProps) {

return (
<SafeAreaView edges={edges} style={{ flex: 1 }}>
<TrackScreen category="Web3Hub" page="Search" />
<Header navigation={navigation} onSearch={setSearch} layoutY={layoutY} />
<View
style={{
Expand Down

0 comments on commit 32b33b6

Please sign in to comment.