Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

navigator share 기능 제거 #430

Merged
merged 1 commit into from
Jul 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/pages/dna/LoadedDna.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { getUserInfoBySurveyIdQueryKey } from '~/hooks/api/user/useGetUserInfoBy
import useInternalRouter from '~/hooks/router/useInternalRouter';
import { BODY_1, HEAD_2_BOLD } from '~/styles/typo';
import { detectMobileDevice, getBrowser } from '~/utils/browser';
import { imageDownloadPC, imageShare } from '~/utils/image';
import { imageDownloadPC } from '~/utils/image';
import { type Group } from '~/utils/resultLogic';

import { type DnaOwnerStatus } from './type';
Expand Down Expand Up @@ -76,11 +76,12 @@ const LoadedDna: FC<Props> = ({
const imageBase64 = 'data:image/png;base64,' + imageObj.base64 ?? '';
const browser = getBrowser();

if (typeof navigator.share !== 'undefined') {
const isImageShared = await imageShare(imageBase64);
// TODO: share 갤러리에 저장 기능 되살리기
// if (typeof navigator.share !== 'undefined') {
// const isImageShared = await imageShare(imageBase64);

if (isImageShared) return;
}
// if (isImageShared) return;
// }

if (!detectMobileDevice() || browser === 'Safari') {
imageDownloadPC(imageBase64, 'dna');
Expand Down Expand Up @@ -110,7 +111,7 @@ const LoadedDna: FC<Props> = ({
<source srcSet={IMAGE_BY_GROUP[group].webp} type="image/webp" />
<Image priority unoptimized css={dnaImageCss} src={IMAGE_BY_GROUP[group].png} alt="DNA 이미지" fill />
</picture>
{dnaOwnerStatus === 'current_user' && (
{true && (
<button type="button" css={downloadIconCss} onClick={onDownloadClick}>
<DownloadCircleIcon />
</button>
Expand Down
Loading