Skip to content

Commit 27a5257

Browse files
committed
fix: Frame Studio reset loads default photo, shorten grid type labels
1 parent 682e86a commit 27a5257

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/app/[locale]/frame-studio/_components/FrameStudio.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ export function FrameStudio() {
9090
setAspectRatio('original')
9191
}, [])
9292

93+
const handleReset = useCallback(() => {
94+
setShowExport(false)
95+
handleResetEdits()
96+
fetch(DEFAULT_PHOTO_URL)
97+
.then((res) => res.blob())
98+
.then((blob) => handleFile(new File([blob], 'wildlife.jpg', { type: 'image/jpeg' })))
99+
.catch((err) => console.error('Failed to load default photo', err))
100+
}, [handleResetEdits, handleFile])
101+
93102
const handleDeletePhoto = useCallback(() => {
94103
setOriginalFile(null)
95104
setOriginalImage(null)
@@ -113,7 +122,7 @@ export function FrameStudio() {
113122
<div className={styles.app}>
114123
<div className={styles.appBody}>
115124
<aside className={styles.sidebar}>
116-
<ToolActions toolSlug={SLUG} onReset={handleDeletePhoto} />
125+
<ToolActions toolSlug={SLUG} onReset={handleReset} />
117126
<FrameSidebar {...sidebarProps} />
118127
</aside>
119128

src/lib/i18n/messages/en/tools/frame-studio.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@
5353
"gridOverlay": "Grid Overlay",
5454
"gridType": "Type",
5555
"gridNone": "None",
56-
"gridRuleOfThirds": "Rule of Thirds",
56+
"gridRuleOfThirds": "3x3",
5757
"gridGoldenRatio": "Golden Ratio",
5858
"gridGoldenSpiral": "Golden Spiral",
5959
"gridGoldenDiagonal": "Golden Diagonal",
6060
"gridDiagonal": "Diagonal",
6161
"gridCenterCross": "Center Cross",
62-
"gridSquareGrid": "Square Grid",
62+
"gridSquareGrid": "4x3",
6363
"gridTriangles": "Triangles",
6464
"rotation": "Rotation",
6565
"gridDensity": "Grid Density:",

0 commit comments

Comments
 (0)