Skip to content

Commit b1ed382

Browse files
authored
feat: add store review prompts for desktop and mobile (#4909)
1 parent 33f3d1d commit b1ed382

File tree

31 files changed

+2059
-13
lines changed

31 files changed

+2059
-13
lines changed

apps/desktop/layer/main/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
},
1212
"exports": {
1313
".": {
14-
"import": "./export.js"
14+
"types": "./dist/export.d.ts",
15+
"import": "./dist/export.js"
1516
}
1617
},
18+
"types": "./dist/export.d.ts",
1719
"scripts": {
1820
"build": "tsc",
1921
"test": "vitest",

apps/desktop/layer/main/preload/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const isWindows11 = detectingWindows11()
2929
// Custom APIs for renderer
3030
const api = {
3131
canWindowBlur: process.platform === "darwin" || (process.platform === "win32" && isWindows11),
32+
isWindowsStore: Boolean((process as typeof process & { windowsStore?: boolean }).windowsStore),
3233
}
3334

3435
// Use `contextBridge` APIs to expose Electron APIs to

apps/desktop/layer/renderer/global.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { ElectronAPI } from "@electron-toolkit/preload"
33
declare global {
44
interface Window {
55
electron?: ElectronAPI
6-
api?: { canWindowBlur: boolean }
6+
api?: { canWindowBlur: boolean; isWindowsStore: boolean }
77
platform: NodeJS.Platform
88
}
99
export const APP_NAME = "Folo"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { Button } from "@follow/components/ui/button/index.js"
2+
import { useTranslation } from "react-i18next"
3+
4+
export const ReviewPromptModalContent = ({
5+
dismiss,
6+
onNegative,
7+
onPositive,
8+
}: {
9+
dismiss: () => void
10+
onNegative: () => void
11+
onPositive: () => void
12+
}) => {
13+
const { t } = useTranslation("settings")
14+
15+
return (
16+
<div className="flex min-w-80 max-w-md flex-col gap-4">
17+
<p className="text-sm leading-relaxed text-text-secondary">{t("reviewPrompt.description")}</p>
18+
19+
<div className="flex items-center justify-end gap-3">
20+
<Button
21+
variant="outline"
22+
onClick={() => {
23+
onNegative()
24+
dismiss()
25+
}}
26+
>
27+
{t("reviewPrompt.notReally")}
28+
</Button>
29+
30+
<Button
31+
onClick={() => {
32+
onPositive()
33+
dismiss()
34+
}}
35+
>
36+
{t("reviewPrompt.loveIt")}
37+
</Button>
38+
</div>
39+
</div>
40+
)
41+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
let triggerReviewPromptDebug: (() => void) | null = null
2+
let resetReviewPromptDebug: (() => void) | null = null
3+
4+
export const setDesktopReviewPromptDebugAction = (callback: (() => void) | null) => {
5+
triggerReviewPromptDebug = callback
6+
}
7+
8+
export const openDesktopReviewPromptDebug = () => {
9+
triggerReviewPromptDebug?.()
10+
}
11+
12+
export const setDesktopReviewPromptResetAction = (callback: (() => void) | null) => {
13+
resetReviewPromptDebug = callback
14+
}
15+
16+
export const resetDesktopReviewPromptDebug = () => {
17+
resetReviewPromptDebug?.()
18+
}

0 commit comments

Comments
 (0)