MCPcopy Create free account
hub / github.com/dailydotdev/apps / useRateAppRow

Function useRateAppRow

packages/shared/src/hooks/useRateAppRow.ts:22–43  ·  view source on GitHub ↗
(source: string)

Source from the content-addressed store, hash-verified

20 * prompts.
21 */
22export const useRateAppRow = (source: string): UseRateAppRow => {
23 const { logEvent } = useLogContext();
24 const isEnabled = useFeature(featureAppStoreReview);
25 // The bridge is only known on the client, so read it after mount.
26 const [canReview, setCanReview] = useState(false);
27
28 useEffect(() => {
29 setCanReview(iOSSupportsReview());
30 }, []);
31
32 return {
33 isVisible: canReview && !!isEnabled,
34 onClick: () => {
35 logEvent({
36 event_name: LogEvent.Click,
37 target_type: TargetType.AppStoreReview,
38 target_id: source,
39 });
40 openIOSWriteReview();
41 },
42 };
43};

Callers 2

YouPageFunction · 0.90
ResourceSectionFunction · 0.90

Calls 5

useLogContextFunction · 0.90
useFeatureFunction · 0.90
iOSSupportsReviewFunction · 0.90
openIOSWriteReviewFunction · 0.90
logEventFunction · 0.85

Tested by

no test coverage detected