Skip to content

Commit

Permalink
feat : 신입 공고 페이지 퍼블리싱 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
Yujin-Baek committed Nov 29, 2023
1 parent 0881b85 commit 02d52cb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
9 changes: 3 additions & 6 deletions frontend/src/app/recruitment/announcement/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
import AnnouncementCard from '@/components/recruitment/announcement/AnnouncementCard'
import { AnnouncementDataType } from '@/utils/types'
import { useInfiniteQuery } from '@tanstack/react-query'
import { useEffect, useState } from 'react'
import { useEffect } from 'react'

export default function Announcement() {
const accessToken =
typeof window !== 'undefined' ? sessionStorage.getItem('accessToken') : null
const persistToken =
typeof window !== 'undefined' ? localStorage.getItem('persistToken') : null
const [postCount, setPostCount] = useState(0)

const getData = async ({ pageParam = 1 }) => {
const params = new URLSearchParams()
Expand All @@ -34,8 +33,6 @@ export default function Announcement() {
}

const data = await res.json()
setPostCount(data.data.length)
console.log(data.data)
return data.data
}

Expand Down Expand Up @@ -69,8 +66,8 @@ export default function Announcement() {

return (
<div className="relative flex flex-col items-center w-screen h-auto min-h-screen pb-12 pt-24">
<div className="w-[860px] border-b-2 p-2">
<span className="text-[13px]">신입 채용 공고</span>
<div className="w-[900px] mb-6 ml-2 border-b-[1px] pb-2">
<span className="text-[14px]">신입 채용 공고</span>
</div>
{data.pages.map((group, i) => (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,41 @@ type PropsType = {

export default function AnnouncementCard({ item }: PropsType) {
const extractMonthAndDay = (dateString: string): string => {
// ISO 형식의 문자열을 Date 객체로 변환
if (dateString === '9999-12-31T00:00:00') {
return '상시채용'
}

const date = new Date(dateString)

// 월과 일을 추출 (월은 0부터 시작하므로 1을 더함)
const month = date.getMonth() + 1
const day = date.getDate()

// 'MM-DD' 형식의 문자열로 반환
return `${month.toString().padStart(2, '0')}/${day
return `~ ${month.toString().padStart(2, '0')}/${day
.toString()
.padStart(2, '0')}`
.padStart(2, '0')} 까지`
}

return (
<div className="w-[860px] flex h-24 items-center border-b-2">
<div className="w-40 h-full flex items-center border-r-2 p-4">
<span className="truncate">{item.companyName}</span>
<div className="w-[900px] flex h-28 items-center mb-2 rounded-2xl shadow-gray-300 shadow-sm">
<div className="w-[180px] h-16 flex items-center border-r-2 border-gray-100 p-6">
<span className="truncate text-[14px]">{item.companyName}</span>
</div>
<div className="flex flex-col w-[580px] p-4">
<h1 className="truncate text-[17px] font-semibold mb-1">
<div className="flex flex-col w-[570px] p-6">
<h1 className="truncate text-[15px] font-semibold mb-1">
{item.title}
</h1>
<a
target="_blank"
href={item.url}
rel="noreferrer"
className="text-[14px] text-graphyblue underline "
className="text-[13px] text-graphyblue underline "
>
채용공고 바로가기
</a>
</div>
<div className="w-[120px] h-full flex justify-end items-end p-2">
<div className="w-[150px] h-full flex justify-end items-end p-4">
<span className="text-gray-400 text-[13px]">
~{extractMonthAndDay(item.expirationDate)}
{extractMonthAndDay(item.expirationDate)}
</span>
</div>
</div>
Expand Down

0 comments on commit 02d52cb

Please sign in to comment.