Skip to content

Commit

Permalink
Merge pull request #1015 from peer-42seoul/release-1.0.4
Browse files Browse the repository at this point in the history
Release 1.0.4
  • Loading branch information
HiHoi authored Feb 14, 2024
2 parents c6ef011 + b8889e8 commit e877f97
Show file tree
Hide file tree
Showing 17 changed files with 619 additions and 638 deletions.
226 changes: 113 additions & 113 deletions public/icons/icons.json

Large diffs are not rendered by default.

897 changes: 447 additions & 450 deletions public/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/api/fetchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const fetchServerData = async (url: string) => {
})
return response.data
} catch (e) {
console.error(e)
console.error('fetchServerData error')
}
}

Expand Down
17 changes: 13 additions & 4 deletions src/app/admin/announce/Announce.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ const Announce = () => {
} = useModal()

const [currentNoticeStatus, setCurrentNoticeStatus] = useState('없음')
const [currentContent, setCurrentContent] = useState('')
const [currentDate, setCurrentDate] = useState('')

// 초기 페이지 진입시 공지사항 목록 불러오기
useEffect(() => {
Expand Down Expand Up @@ -331,7 +333,8 @@ const Announce = () => {
setValue('content', res.data.content)
setValue('date', res.data.date)
setValue('announcementStatus', res.data.announcementStatus)

setCurrentDate(res.data.date)
setCurrentContent(res.data.content)
let noticeStatusValue = '없음' // 기본값
if (
res.data.announcementStatus === '게제' ||
Expand Down Expand Up @@ -566,10 +569,15 @@ const Announce = () => {
: '게제된 시간'}
</Typography>
<TextField
// value={
// getValues('date')?.split('T')[0] +
// ' ' +
// getValues('date')?.split('T')[1]
// }
value={
getValues('date')?.split('T')[0] +
currentDate?.split('T')[0] +
' ' +
getValues('date')?.split('T')[1]
currentDate?.split('T')[1]
}
disabled={true}
/>
Expand All @@ -578,7 +586,8 @@ const Announce = () => {
{writeMode === 'view' ? (
<Box>
<DynamicToastViewer
initialValue={getValues('content')}
// initialValue={getValues('content')}
initialValue={currentContent}
sx={{
width: '100%',
wordBreak: 'break-word',
Expand Down
1 change: 1 addition & 0 deletions src/app/my-page/interests/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ const MyInterests = () => {
<Stack
width={1}
height={1}
minHeight={'4.5rem'}
sx={{
backgroundColor: ['transparent', 'background.secondary'],
borderRadius: '1rem',
Expand Down
26 changes: 6 additions & 20 deletions src/app/panel/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ import SearchOptionPanel, {
InfinityScrollPanel,
} from '@/app/panel/main-page/MainPanel'
import SelectSort from '@/app/panel/main-page/SelectSort'
import { getCookie } from 'cookies-next'
import { io } from 'socket.io-client'
import useMedia from '@/hook/useMedia'

export interface BeforeInstallPromptEvent extends Event {
Expand All @@ -60,15 +58,6 @@ export interface IDetailOption {
tag: string
}

export const socket = getCookie('accessToken')
? io(`${process.env.NEXT_PUBLIC_SOCKET}`, {
transports: ['socket.io', 'websocket'],
query: {
accessToken: getCookie('accessToken'),
},
})
: null

const MainPage = ({ initData }: { initData: IPagination<IPost[]> }) => {
const searchParams = useSearchParams()
const keyword = searchParams.get('keyword') ?? ''
Expand Down Expand Up @@ -182,13 +171,6 @@ const MainPage = ({ initData }: { initData: IPagination<IPost[]> }) => {
scrollTo(target.current.scrollHeight - prevScrollHeight)
}, [newData])

useEffect(() => {
if (!socket) return
socket.on('connect', () => {
console.log('socket connected')
})
}, [])

const { target, spinner, scrollTo } = useInfiniteScrollHook(
setPage,
isLoading,
Expand Down Expand Up @@ -250,7 +232,9 @@ const MainPage = ({ initData }: { initData: IPagination<IPost[]> }) => {
<Container sx={{ ...containerStyle, paddingBottom: '1.25rem' }}>
{keyword === '' ? (
<>
<MainBanner />
<Box width={'100%'}>
<MainBanner />
</Box>
<Box marginY={'0.5rem'}>
<SelectType type={type} setType={handleType} />
</Box>
Expand Down Expand Up @@ -333,7 +317,9 @@ const MainPage = ({ initData }: { initData: IPagination<IPost[]> }) => {
<Stack flex={1} gap={'0.5rem'}>
{keyword === '' ? (
<>
<MainBanner />
<Box width={'100%'}>
<MainBanner />
</Box>
<Stack direction={'row'} justifyContent={'space-between'}>
<SelectType type={type} setType={handleType} />
<Tutorial
Expand Down
12 changes: 6 additions & 6 deletions src/app/panel/PushAlertBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ const PushAlertBanner = () => {
message: '푸시 알림 테스트 메시지입니다.',
},
)
.then((res) => {
console.log(res)
.then(() => {
console.log('푸시 알림 전송 성공')
})
} else {
console.log(
'No registration token available. Request permission to generate one.',
)
}
})
.catch((err: any) => {
console.log('An error occurred while retrieving token. ', err)
.catch(() => {
console.log('An error occurred while retrieving token. ')
})

onMessage(messaging, (payload: any) => {
console.log('Message received. ', payload)
onMessage(messaging, () => {
console.log('Message received. ')
})
}

Expand Down
8 changes: 7 additions & 1 deletion src/app/panel/layout-panel/AlertIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { CircularProgress, IconButton } from '@mui/material'
import NotificationIcon from '@/icons/NotificationIcon'
import useMedia from '@/hook/useMedia'
import { usePathname, useSearchParams } from 'next/navigation'

// 알림 잠그기

Expand Down Expand Up @@ -117,6 +118,8 @@ const AlertIcon = () => {
const [isDrawerOpen, setIsDrawerOpen] = useState(false)
const { isLogin } = useAuthStore()
const router = useRouter()
const pathname = usePathname()
const searchParams = useSearchParams()

const { target, spinner } = useInfiniteScroll({
setPage,
Expand All @@ -129,7 +132,7 @@ const AlertIcon = () => {

useEffect(() => {
isNewAlarm(isLogin)
}, [])
}, [pathname, searchParams, isLogin, isNewAlarm])

useEffect(() => {
if (isDrawerOpen) {
Expand All @@ -141,6 +144,9 @@ const AlertIcon = () => {
if (isAlertComing) {
setIsAlertComing(false)
}
} else {
resetAlarms()
setPage(1)
}
}, [isDrawerOpen, setIsAlertComing, tabvalue])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ const EditModalContent = ({
.then((res) => {
scheduleData.eventId = res.data // eventId를 받아옴
})
.catch((e) => {
console.error(e)
})
.catch(() => {})
.finally(() => {
// TODO : 위젯 업데이트
openToast({
Expand Down
23 changes: 0 additions & 23 deletions src/app/teams/[id]/setting/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import SetupInfo from './panel/SettingTeamInfo'
import CuCircularProgress from '@/components/CuCircularProgress'
import Tutorial from '@/components/Tutorial'
import TeamMemberTutorial from '@/components/tutorialContent/TeamMemberTutorial'
import { socket } from '@/app/panel/MainPage'

export interface IMyInfo {
userId: string
Expand Down Expand Up @@ -44,28 +43,6 @@ const TeamsSetupPage = ({ params }: { params: { id: string } }) => {
const openApplicant = () => setShowApplicant(true)
const closeApplicant = () => setShowApplicant(false)

useEffect(() => {
if (!socket) return

console.log('socket', socket.connected, socket.id)

socket.emit(
'whoAmI',
{
teamId: params.id,
teamName: data?.team.name,
},
(data: any) => {
console.log('whoAmI', data)
},
)

return () => {
if (!socket) return
socket.off('whoAmI')
}
}, [])

if (error) {
if (isAxiosError(error) && error.response?.status === 403) {
alert('팀 설정은 팀 리더만 가능합니다.')
Expand Down
2 changes: 1 addition & 1 deletion src/app/teams/[id]/showcase/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ShowcaseGenerationPage = ({ params }: { params: { id: string } }) => {
(url: string) => axiosWithAuth.get(url).then((res) => res.data),
{ shouldRetryOnError: false },
)
console.log('에러', error?.response.data.message)

if (isLoading) return <CuCircularProgress color={'secondary'} />
if (error)
return (
Expand Down
13 changes: 10 additions & 3 deletions src/components/CuAvatar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
'use client'
import { Avatar, AvatarProps } from '@mui/material'
import * as style from './CuAvatar.style'
import React from 'react'
import React, { useState } from 'react'
import Image from 'next/image'

// https://stackoverflow.com/questions/65001113/using-the-new-next-js-image-component-with-material-ui 참고하여 처리하였습니다.

const CuAvatar = React.forwardRef<HTMLDivElement, AvatarProps>(
function CuAvatar(props: AvatarProps, ref) {
const [error, setError] = useState(false)
return (
<Avatar
{...props}
Expand All @@ -16,8 +18,13 @@ const CuAvatar = React.forwardRef<HTMLDivElement, AvatarProps>(
>
{props.children ? (
props.children
) : props.src ? (
<Image src={props.src} alt={props?.alt || ''} layout="fill" />
) : props.src && !error ? (
<Image
src={props.src}
alt={props?.alt || ''}
layout="fill"
onError={() => setError(true)}
/>
) : (
<></>
)}
Expand Down
10 changes: 8 additions & 2 deletions src/components/CuPhotoBox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'
import { Box } from '@mui/material'
import Image from 'next/image'
import React from 'react'
import React, { useState } from 'react'

interface ICuPhotoBoxProps {
onClick?: () => void
Expand All @@ -19,23 +20,28 @@ const CuPhotoBox = ({
objectStyle = 'cover',
onClick,
}: ICuPhotoBoxProps) => {
const [error, setError] = useState(false)
return (
<Box
onClick={onClick}
style={{
...style,
position: 'relative',
margin: 0,
backgroundColor: '#ffffff',
border: '1px solid',
borderColor: 'line.alternative',
}}
>
{src && (
{src && !error && (
<Image
src={src}
alt={alt}
fill
style={{ objectFit: objectStyle }}
sizes="100%"
priority={priorityOption}
onError={() => setError(true)}
/>
)}
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ToastUIEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const ToastEditor = ({
)
callback(response.data, '이미지 대체 텍스트')
} catch (error) {
console.error('이미지 업로드 실패', error)
console.error('이미지 업로드 실패')
}
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/ToastUIEditorAdmin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const ToastEditorAdmin = ({
)
callback(response.data, '이미지 대체 텍스트')
} catch (error) {
console.error('이미지 업로드 실패', error)
console.error('이미지 업로드 실패')
}
},
},
Expand Down
8 changes: 2 additions & 6 deletions src/components/dropdownMenu/ShareMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@ export const handleShare = (
url: url,
text: content,
})
.catch((e) => {
console.error(e)
})
.catch(() => {})
} else {
if (navigator.clipboard) {
navigator.clipboard
.writeText(message || url)
.then(() => alert('클립보드에 복사되었습니다.'))
.catch((e) => {
console.error(e)
})
.catch(() => {})
} else {
const textarea = document.createElement('textarea')
textarea.value = message || url
Expand Down
4 changes: 1 addition & 3 deletions src/states/useAuthStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ const useAuthStore = create<IAuthStore>((set) => {
const nickname = res.data.nickname
useNicknameStore.getState().setNickname(nickname)
})
.catch((err) => {
console.error(err)
})
.catch(() => {})
// set state
set(() => ({
isLogin: true,
Expand Down

0 comments on commit e877f97

Please sign in to comment.