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9B,IAA8BA,OAA9B,EAA8BA,EAAMqD,WAAWE,KAAKC,W,uDCkB1DC,GAAY3D,EAAAA,EAAAA,IAAH,+BAECC,EAAAA,EAAAA,OAAAA,MAFD,oEAWf,EAxDgB,WACd,IAAQ2D,GAAMC,EAAAA,EAAAA,KAAND,EACFjB,GAASC,EAAAA,EAAAA,aACTkB,GAAetC,EAAAA,EAAAA,QAAuB,MAE5C,EAAoDiB,EAAmB,CACrEsB,KAAM,EACNC,SATuB,KAOjB9D,EAAR,EAAQA,KAAMkD,EAAd,EAAcA,UAAWC,EAAzB,EAAyBA,cAAeC,EAAxC,EAAwCA,QAKlC7B,GAAewC,EAAAA,EAAAA,GAAkBH,GAgBvC,OAdAzD,EAAAA,EAAAA,YAAU,WACJoB,GAAgB6B,GAClBF,EAAU,CACRV,UAAW,CACTqB,KAAM7D,EAAOA,EAAKqD,WAAWQ,KAAO,EAAI,OAI7C,CAACtC,EAAc6B,KAElBjD,EAAAA,EAAAA,YAAU,YACR6D,EAAAA,EAAAA,QACC,KAGD,yBACE,QAAC,KAAD,CACEC,OAAQ,kBAAMxB,EAAOQ,KAAK,UAC1BnC,MAAO4C,EAAE,+BAEX,gBAAM5D,IAAK2D,IACT,mBAAS9C,UAAU,eAAnB,OACGX,QADH,IACGA,OADH,EACGA,EAAMqD,WAAWE,KAAKW,KAAI,SAACC,GAAD,OACzB,QAAC,EAAAC,EAAD,CAAYpE,KAAMmE,EAAQE,IAAKF,EAAO9D,cAEvC8C,IAAkBmB,EAAAA,GAAAA,UAAyB,QAAC,KAAD,OAC5C,eAAKC,IAAKX,Q,KCtCpB,EAJoB,WAClB,OAAO,QAACY,EAAD,Q,uBCXJC,OAAOC,SAAWD,OAAOC,UAAY,IAAIzB,KAAK,CAC7C,WACA,WACE,OAAO,EAAQ,Y","sources":["webpack://_N_E/./src/components/notice/common/NoticeItem.tsx","webpack://_N_E/./src/hooks/useInfiniteScroll.ts","webpack://_N_E/./src/operations/queries/notice/__generated__/useGetListNotice.generated.ts","webpack://_N_E/./src/operations/queries/notice/useGetListNotice.ts","webpack://_N_E/./src/components/notice/Notice.tsx","webpack://_N_E/./src/pages/notices/index.tsx","webpack://_N_E/?e8c2"],"sourcesContent":["import React, { useState, useCallback, useEffect } from 'react';\nimport { css } from '@emotion/react';\nimport theme from '@styles/theme';\nimport { DownBtn } from 'public/assets';\nimport { Notice } from '@customTypes/notice';\nimport { formatDate } from '@common/utils';\nimport { viewNoticeDetail } from '@/lib/eventManager';\n\ninterface INoticeItem {\n data: Notice;\n isDetail?: boolean;\n}\n\nconst NoticeItem = ({ data, isDetail = false }: INoticeItem) => {\n const [isOpen, setIsOpen] = useState(isDetail);\n\n useEffect(() => {\n isOpen &&\n viewNoticeDetail({\n noticeId: String(data?.noticeId),\n });\n }, [isOpen]);\n\n const convertLink = useCallback((contents: string) => {\n let resultText;\n // http://, https://로 url이 시작한다면.\n const HTTP_REG =\n /(\\b(https?):\\/\\/[-A-Z0-9+&@#\\/%?=~_|!:,.;]*[-A-Z0-9+&@#\\/%=~_|])/gim;\n resultText = contents.replace(\n HTTP_REG,\n '$1',\n );\n\n // http?없이 www로 시작한다면.\n const WWW_REG = /(^|[^\\/])(www\\.|bit\\.[\\S]+(\\b|$))/gim;\n resultText = resultText.replace(\n WWW_REG,\n '$1$2',\n );\n\n // 메일 주소일 경우\n const MAIL_REG = /(([a-zA-Z0-9\\-\\_\\.])+@[a-zA-Z\\_]+?(\\.[a-zA-Z]{2,6})+)/gim;\n resultText = resultText.replace(MAIL_REG, '$1');\n\n return resultText;\n }, []);\n\n const handleNoticeItemClick = () => {\n setIsOpen((prev) => !prev);\n };\n\n return (\n
\n
\n
\n

{data.title}

\n

{formatDate(new Date(data.createdAt))}

\n
\n {!isDetail && }\n
\n \n
\n );\n};\n\nconst itemWrapper = ({\n isOpen,\n isDetail,\n}: {\n isOpen: boolean;\n isDetail: boolean;\n}) => css`\n a {\n color: ${theme.colors.primary300};\n text-decoration: underline;\n word-break: break-all;\n\n &:visited {\n color: ${theme.colors.primary300};\n }\n }\n\n .label {\n width: 100%;\n min-height: 4.75rem;\n border-bottom: 0.0625rem solid ${theme.colors.gray300};\n padding: 1rem 1.25rem;\n display: flex;\n align-items: center;\n justify-content: space-between;\n ${!isDetail && `cursor: pointer;`}\n\n .left-wrapper {\n width: 100%;\n\n .title {\n color: ${theme.colors.gray900};\n font: ${theme.font.body2Normal};\n font-size: 1rem;\n }\n\n .date {\n margin-top: 0.25rem;\n font: ${theme.font.body3Normal};\n color: ${theme.colors.gray600};\n }\n }\n\n .icon {\n margin: 0.1rem;\n flex-shrink: 0;\n transition: all 0.4s;\n }\n }\n\n .contents {\n background: ${theme.colors.gray100};\n color: ${theme.colors.gray700};\n white-space: pre-wrap;\n font: ${theme.font.body2Normal};\n overflow: hidden;\n height: 0;\n padding-top: 0;\n padding-bottom: 0;\n padding-left: 0;\n padding-right: 0;\n visibility: hidden;\n transition: padding-top 0.5s, padding-bottom 0.5s, height 2s, transform 1s;\n }\n\n ${isOpen &&\n `\n .contents {\n height:inherit;\n padding-top: 1.25rem;\n padding-bottom: 1.25rem;\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n visibility: visible;\n transition: padding-top 0.5s, padding-bottom 0.5s, height 2s, transform 1s;\n }\n\n .label {\n .icon {\n transform: rotate(180deg)\n } \n } \n `}\n\n @media screen and (max-width: ${theme.devices.mobile}) {\n width: 100%;\n }\n`;\n\nexport default NoticeItem;\n","import { useRef, useState, useEffect, useCallback, RefObject } from 'react';\n\nconst useInfiniteScroll = (target: RefObject) => {\n const observerRef = useRef();\n const [intersecting, setIntersecting] = useState(false);\n\n const getObserver = useCallback(() => {\n if (!observerRef.current) {\n observerRef.current = new IntersectionObserver((entries) =>\n setIntersecting(entries.some((entry) => entry.isIntersecting)),\n );\n }\n return observerRef.current;\n }, [observerRef.current]);\n\n useEffect(() => {\n if (target.current) getObserver().observe(target.current);\n\n return () => {\n getObserver().disconnect();\n };\n }, [target.current]);\n\n return intersecting;\n};\n\nexport default useInfiniteScroll;\n","import * as Types from '../../../../baseType';\n\nimport { gql } from '@apollo/client';\nimport * as Apollo from '@apollo/client';\nconst defaultOptions = {} as const;\nexport type NoticeItemFragment = { __typename?: 'Notice', noticeId: number, contents: string, title: string, createdAt: any, updatedAt: any };\n\nexport type NoticeListQueryVariables = Types.Exact<{\n page: Types.Scalars['Int'];\n pageSize?: Types.InputMaybe;\n}>;\n\n\nexport type NoticeListQuery = { __typename?: 'Query', listNotice: { __typename?: 'ListableNotice', totalCount: number, page: number, pageSize: number, list: Array<{ __typename?: 'Notice', noticeId: number, contents: string, title: string, createdAt: any, updatedAt: any }> } };\n\nexport const NoticeItemFragmentDoc = gql`\n fragment NoticeItem on Notice {\n noticeId\n contents\n title\n createdAt\n updatedAt\n}\n `;\nexport const NoticeListDocument = gql`\n query NoticeList($page: Int!, $pageSize: Int) {\n listNotice(data: {page: $page, pageSize: $pageSize}) {\n list {\n ...NoticeItem\n }\n totalCount\n page\n pageSize\n }\n}\n ${NoticeItemFragmentDoc}`;\n\n/**\n * __useNoticeListQuery__\n *\n * To run a query within a React component, call `useNoticeListQuery` and pass it any options that fit your needs.\n * When your component renders, `useNoticeListQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useNoticeListQuery({\n * variables: {\n * page: // value for 'page'\n * pageSize: // value for 'pageSize'\n * },\n * });\n */\nexport function useNoticeListQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(NoticeListDocument, options);\n }\nexport function useNoticeListLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(NoticeListDocument, options);\n }\nexport type NoticeListQueryHookResult = ReturnType;\nexport type NoticeListLazyQueryHookResult = ReturnType;\nexport type NoticeListQueryResult = Apollo.QueryResult;","import { gql } from '@apollo/client';\nimport {\n useNoticeListQuery as useQuery,\n NoticeListQueryVariables,\n} from './__generated__/useGetListNotice.generated';\nimport { useRouter } from 'next/router';\n\nexport const NOTICE_ITEM = gql`\n fragment NoticeItem on Notice {\n noticeId\n contents\n title\n createdAt\n updatedAt\n }\n`;\n\nexport const NOTICE_LIST = gql`\n query NoticeList($page: Int!, $pageSize: Int) {\n listNotice(data: { page: $page, pageSize: $pageSize }) {\n list {\n ...NoticeItem\n }\n totalCount\n page\n pageSize\n }\n }\n ${NOTICE_ITEM}\n`;\n\nexport const useNoticeListQuery = (variables: NoticeListQueryVariables) => {\n const router = useRouter();\n const { data, fetchMore, networkStatus } = useQuery({\n notifyOnNetworkStatusChange: true,\n variables,\n onError: () => {\n router.push('/404');\n },\n });\n\n const hasNext =\n data && data?.listNotice.totalCount > data?.listNotice.list.length;\n\n return { data, fetchMore, networkStatus, hasNext };\n};\n","import React, { useEffect, useRef } from 'react';\nimport useTranslation from 'next-translate/useTranslation';\nimport { useRouter } from 'next/router';\nimport { css } from '@emotion/react';\nimport theme from '@styles/theme';\nimport { NoticeItemFragment } from '@operations/queries/notice/__generated__/useGetListNotice.generated';\nimport { useNoticeListQuery } from '@operations/queries/notice/useGetListNotice';\nimport useInfiniteScroll from '@hooks/useInfiniteScroll';\nimport { NetworkStatus } from '@common/values';\nimport { SPLoading, BackHeader } from '@components/commons';\nimport { NoticeItem } from '@components/notice/common';\nimport { viewNotice } from '@/lib/eventManager';\n\nconst DEFAULT_PAGE_COUNT = 10;\n\nconst Notices = () => {\n const { t } = useTranslation();\n const router = useRouter();\n const fetchMoreRef = useRef(null);\n\n const { data, fetchMore, networkStatus, hasNext } = useNoticeListQuery({\n page: 1,\n pageSize: DEFAULT_PAGE_COUNT,\n });\n\n const intersecting = useInfiniteScroll(fetchMoreRef);\n\n useEffect(() => {\n if (intersecting && hasNext) {\n fetchMore({\n variables: {\n page: data ? data.listNotice.page + 1 : 1,\n },\n });\n }\n }, [intersecting, hasNext]);\n\n useEffect(() => {\n viewNotice();\n }, []);\n\n return (\n <>\n router.push('/more')}\n title={t('more_screen_title_notice')}\n />\n
\n
\n {data?.listNotice.list.map((notice: NoticeItemFragment) => (\n \n ))}\n {networkStatus === NetworkStatus.loading && }\n
\n
\n
\n \n );\n};\n\nconst container = css`\n padding-top: 4rem;\n background: ${theme.colors.white};\n\n .notice-list {\n width: 100%;\n display: flex;\n flex-direction: column;\n }\n`;\n\nexport default Notices;\n","\n// @ts-ignore\n import __i18nConfig from '@next-translate-root/i18n'\n// @ts-ignore\n import __loadNamespaces from 'next-translate/loadNamespaces'\n// @ts-ignore\n \nimport React from 'react';\n\nimport Notice from '@components/notice/Notice';\n\nconst NoticesPage = () => {\n return ;\n};\n\nexport default NoticesPage;\n\n\n// @ts-ignore\n export async function getStaticProps(ctx) {\n// @ts-ignore\n \n// @ts-ignore\n \n// @ts-ignore\n return {\n// @ts-ignore\n \n// @ts-ignore\n \n// @ts-ignore\n props: {\n// @ts-ignore\n \n// @ts-ignore\n ...(await __loadNamespaces({\n// @ts-ignore\n ...ctx,\n// @ts-ignore\n pathname: '/notices/index',\n// @ts-ignore\n loaderName: 'getStaticProps',\n// @ts-ignore\n ...__i18nConfig,\n// @ts-ignore\n loadLocaleFrom: (l, n) => import(`@next-translate-root/locales/${l}/${n}`).then(m => m.default),\n// @ts-ignore\n }))\n// @ts-ignore\n }\n// @ts-ignore\n }\n// @ts-ignore\n }\n// @ts-ignore\n ","\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/notices\",\n function () {\n return require(\"private-next-pages/notices/index.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/notices\"])\n });\n }\n "],"names":["itemWrapper","isOpen","isDetail","css","theme","data","useState","setIsOpen","useEffect","viewNoticeDetail","noticeId","String","convertLink","useCallback","contents","replace","className","onClick","prev","title","formatDate","Date","createdAt","dangerouslySetInnerHTML","__html","target","observerRef","useRef","intersecting","setIntersecting","getObserver","current","IntersectionObserver","entries","some","entry","isIntersecting","observe","disconnect","defaultOptions","NoticeItemFragmentDoc","gql","NoticeListDocument","NOTICE_ITEM","useNoticeListQuery","variables","router","useRouter","baseOptions","options","Apollo","useQuery","notifyOnNetworkStatusChange","onError","push","fetchMore","networkStatus","hasNext","listNotice","totalCount","list","length","container","t","useTranslation","fetchMoreRef","page","pageSize","useInfiniteScroll","viewNotice","onBack","map","notice","N","key","NetworkStatus","ref","Notice","window","__NEXT_P"],"sourceRoot":""}