This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use client'; | |
import { ReactNode, useEffect, useRef, useState } from 'react'; | |
import { createPortal } from 'react-dom'; | |
type PortalToProps = { | |
/** 예: '#modal-root', '.toast-zone' */ | |
to: string; | |
children: ReactNode; | |
/** true면 포털 비활성화하고 현재 위치에 그냥 렌더 */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RefObject, useEffect, useState } from 'react'; | |
export interface PullToRefreshOptions { | |
/** 당겨서 새로고침이 발생할 거리(px) */ | |
threshold?: number; | |
} | |
/** | |
* usePullToRefresh 훅: 스크롤 가능한 요소에서 아래로 당겨 새로고침 기능을 제공합니다. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export {}; | |
declare global { | |
/* Utility Types */ | |
type Nullable<T> = T | null | undefined; | |
type Optional<T> = T | undefined; | |
/** 값이 Y/N 으로 제한되어 있는 string */ | |
type YN = 'Y' | 'N'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineStore } from 'pinia'; | |
import { computed, ref, watch } from 'vue'; | |
import { | |
ToastOptions, | |
StringNumber, | |
BasicObject, | |
ModalList, | |
LoadingOptions, | |
ModalData, | |
DialogOptions, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useStoreCommon } from '@/store/common'; | |
import { storeToRefs } from 'pinia'; | |
export const useBeforeClose = () => { | |
const storeCommon = useStoreCommon(); | |
const { addBeforeCloseAction, removeBeforeCloseAction } = storeCommon; | |
const { beforeCloseActions } = storeToRefs(storeCommon); | |
// 브라우저 종료 큐 추가 | |
const addQueue = (action: () => void) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import puppeteer from 'puppeteer'; | |
const VIEWPORTS = [ | |
{ width: 1080, height: 1920, name: 'mobile-portrait' }, | |
{ width: 1920, height: 1080, name: 'desktop' }, | |
{ width: 768, height: 1024, name: 'tablet-portrait' }, | |
]; | |
const url = 'http://localhost:3000'; // 여기에 PWA URL 입력 |