Skip to content

Commit

Permalink
Expose counts when selecting
Browse files Browse the repository at this point in the history
  • Loading branch information
robertherber committed Nov 7, 2024
1 parent 1029719 commit d5fbf8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ios/ReactNativeDeviceActivityView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ class ReactNativeDeviceActivityView: ExpoView {
let jsonString = json.base64EncodedString()

onSelectionChange([
"familyActivitySelection": jsonString
"familyActivitySelection": jsonString,
"applicationCount": selection.applicationTokens.count,
"categoryCount": selection.categoryTokens.count,
"webdomainCount": selection.webDomainTokens.count,
])
} catch {

Expand Down
7 changes: 6 additions & 1 deletion src/ReactNativeDeviceActivity.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ export type EventsLookup = Record<string, number>;
export type DeviceActivitySelectionViewProps = PropsWithChildren<{
style: StyleProp<ViewStyle>;
onSelectionChange?: (
selection: NativeSyntheticEvent<{ familyActivitySelection: string }>,
selection: NativeSyntheticEvent<{
familyActivitySelection: string;
appCount: number;
categoryCount: number;
webDomainCount: number;
}>,
) => void;
familyActivitySelection?: string | null;
}>;
Expand Down

0 comments on commit d5fbf8d

Please sign in to comment.