Skip to content

Commit

Permalink
feat(game/result): modify share image filename (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsun969 authored Oct 19, 2023
1 parent ac0583f commit 5dcaa63
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/_game/components/ShareDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { usePostHog } from 'posthog-js/react'
import { useEffect, useRef, useState } from 'react'
import { useOnClickOutside } from 'usehooks-ts'

import { useSceneProps } from '~/stores/SceneProps.store'

import { useUser } from '../hooks/useUser'
import { BorderWithoutCorner } from './BorderWithoutCorner'

function ShareDialogButton({
Expand Down Expand Up @@ -57,6 +60,9 @@ export function ShareDialog({
const dialogRef = useRef<HTMLDivElement>(null)
useOnClickOutside(dialogRef, onClose)

const { user } = useUser()
const { sceneProps } = useSceneProps()

return (
<motion.div
className="fixed"
Expand Down Expand Up @@ -97,8 +103,7 @@ export function ShareDialog({
<a
ref={downloadImageRef}
href={shareLink + '/opengraph-image'}
// TODO: Change image file name
download="isthat.ai_share_image.png"
download={`${user?.name} Test #${sceneProps['MENU'].testId} Result.png`}
className="hidden"
/>
<ShareDialogButton
Expand Down

0 comments on commit 5dcaa63

Please sign in to comment.