Skip to content

Commit

Permalink
어드민 퀘스트 페이지의 건물 이름에 장소 숫자 표기하기
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeniuus committed Nov 5, 2023
1 parent 7ab664d commit 4290f7a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app-admin-frontend/src/page/ClubQuest/ClubQuestPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,16 @@ function ClubQuestPage() {
const getTooltipDisplayedName = (targetBuilding: ClubQuestTargetBuildingDTO): string => {
const placeName = targetBuilding.places[0].name;
let shortenedPlaceName = '';
if (placeName.length <= 7) {
if (placeName.length <= 4) {
shortenedPlaceName = placeName;
} else {
shortenedPlaceName = `${placeName.substring(0, 6)}...`;
shortenedPlaceName = `${placeName.substring(0, 3)}...`;
}
return `${targetBuilding.name}: ${shortenedPlaceName}`;
return `${getBuildingName(targetBuilding)}: ${shortenedPlaceName}`;
}

const getBuildingName = (targetBuilding: ClubQuestTargetBuildingDTO): string => {
return `${targetBuilding.name} (${targetBuilding.places.length}개)`;
}

const installMap = (clubQuest: ClubQuestDTO) => {
Expand Down Expand Up @@ -274,7 +278,7 @@ function ClubQuestPage() {
return building.places.map((place, idx) => {
return (
<tr onClick={() => handleBuildingClick(building)}>
<td>{idx === 0 ? building.name : ''}</td>
<td>{idx === 0 ? getBuildingName(building) : ''}</td>
<td>{place.name}</td>
<td><Checkbox checked={place.isConquered} disabled={true} large /></td>
<td><Checkbox checked={place.isClosed} disabled={isLoading} large onChange={onPlaceIsClosedChange(place)} /></td>
Expand Down

0 comments on commit 4290f7a

Please sign in to comment.