-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(getInitialTravelTitle): 제목 초기값에서 사용자 닉네임 삭제
- 사용자 닉네임을 삭제하면서 훅이 아니게되어 함수이름을 useInitialTravelTitle에서 getInitialTravelTitle로 수정하고 util 폴더로 이동 시켰습니다.
- Loading branch information
Showing
4 changed files
with
27 additions
and
34 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { TravelTransformPlaces } from "@type/domain/travelTransform"; | ||
|
||
import getDaysAndNights from "@utils/getDaysAndNights"; | ||
|
||
type TravelRecordType = "travelogue" | "travelPlan"; | ||
|
||
interface getInitialTravelTitleProps { | ||
days: TravelTransformPlaces[] | undefined; | ||
type: TravelRecordType; | ||
} | ||
|
||
const getInitialTravelTitle = ({ days, type }: getInitialTravelTitleProps) => { | ||
const daysAndNights = getDaysAndNights(days); | ||
|
||
const tripType = type === "travelogue" ? "여행기" : "여행 계획"; | ||
|
||
if (days && days?.length >= 1) return `${daysAndNights} ${tripType}`; | ||
return ""; | ||
}; | ||
|
||
export default getInitialTravelTitle; |