Skip to content

Commit

Permalink
[FE] FIX: 새로고침 시 나타나는 스크롤바 제거하기 위한 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jihyunk03 committed Oct 8, 2024
1 parent bcf8c54 commit 1b07448
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 97 deletions.
119 changes: 59 additions & 60 deletions frontend/src/Cabinet/pages/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,66 +123,65 @@ const MainPage = () => {
setIsCurrentSectionRender(false);
};

return (
<>
{isLoading && <LoadingAnimation />}
<WrapperStyled
ref={mainWrapperRef}
onTouchStart={(e: React.TouchEvent) => {
touchStartPosX.current = e.changedTouches[0].screenX;
touchStartPosY.current = e.changedTouches[0].screenY;
}}
onTouchEnd={(e: React.TouchEvent) => {
swipeSection(
e.changedTouches[0].screenX,
e.changedTouches[0].screenY
);
}}
>
<AlertStyled>
{currentFloorSectionNames.includes(currentSectionName) &&
!isClubSection && (
<IconWrapperStyled
onClick={handleAlertIconBtn}
disabled={
sectionList[currentSectionIndex]?.alarmRegistered
? true
: false
}
>
{sectionList[currentSectionIndex]?.alarmRegistered === true ? (
<FilledHeartIcon />
) : (
<LineHeartIcon />
)}
</IconWrapperStyled>
)}
</AlertStyled>
<SectionPaginationContainer />
<CabinetListWrapperStyled>
<CabinetListContainer isAdmin={false} />
{currentSectionName !== SectionType.elevator &&
currentSectionName !== SectionType.stairs && (
<RefreshButtonStyled
className="cabiButton"
title="새로고침"
id="refreshButton"
onClick={refreshCabinetList}
>
새로고침
</RefreshButtonStyled>
)}
</CabinetListWrapperStyled>
{showSectionAlertModal && (
<SectionAlertModal
currentSectionName={currentSectionName}
setShowSectionAlertModal={setShowSectionAlertModal}
currentBuilding={currentBuilding}
currentFloor={currentFloor}
/>
)}
</WrapperStyled>
</>
return isLoading ? (
<LoadingAnimation />
) : (
<WrapperStyled
ref={mainWrapperRef}
onTouchStart={(e: React.TouchEvent) => {
touchStartPosX.current = e.changedTouches[0].screenX;
touchStartPosY.current = e.changedTouches[0].screenY;
}}
onTouchEnd={(e: React.TouchEvent) => {
swipeSection(
e.changedTouches[0].screenX,
e.changedTouches[0].screenY
);
}}
>
<AlertStyled>
{currentFloorSectionNames.includes(currentSectionName) &&
!isClubSection && (
<IconWrapperStyled
onClick={handleAlertIconBtn}
disabled={
sectionList[currentSectionIndex]?.alarmRegistered
? true
: false
}
>
{sectionList[currentSectionIndex]?.alarmRegistered === true ? (
<FilledHeartIcon />
) : (
<LineHeartIcon />
)}
</IconWrapperStyled>
)}
</AlertStyled>
<SectionPaginationContainer />
<CabinetListWrapperStyled>
<CabinetListContainer isAdmin={false} />
{currentSectionName !== SectionType.elevator &&
currentSectionName !== SectionType.stairs && (
<RefreshButtonStyled
className="cabiButton"
title="새로고침"
id="refreshButton"
onClick={refreshCabinetList}
>
새로고침
</RefreshButtonStyled>
)}
</CabinetListWrapperStyled>
{showSectionAlertModal && (
<SectionAlertModal
currentSectionName={currentSectionName}
setShowSectionAlertModal={setShowSectionAlertModal}
currentBuilding={currentBuilding}
currentFloor={currentFloor}
/>
)}
</WrapperStyled>
);
};

Expand Down
73 changes: 36 additions & 37 deletions frontend/src/Cabinet/pages/admin/AdminMainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,44 +93,43 @@ const AdminMainPage = () => {
else moveToRightSection();
};

return (
<>
{isLoading && <LoadingAnimation />}
<WrapperStyled
ref={mainWrapperRef}
onTouchStart={(e: React.TouchEvent) => {
touchStartPosX.current = e.changedTouches[0].screenX;
touchStartPosY.current = e.changedTouches[0].screenY;
}}
onTouchEnd={(e: React.TouchEvent) => {
swipeSection(
e.changedTouches[0].screenX,
e.changedTouches[0].screenY
);
}}
>
<SectionPaginationContainer />
<MultiSelectButtonWrapperStyled isMultiSelect={isMultiSelect}>
<MultiSelectButton
theme={isMultiSelect ? "fill" : "line"}
text="다중 선택 모드"
onClick={toggleMultiSelectMode}
/>
</MultiSelectButtonWrapperStyled>
<CabinetListWrapperStyled>
<CabinetListContainer isAdmin={true} />
return isLoading ? (
<LoadingAnimation />
) : (
<WrapperStyled
ref={mainWrapperRef}
onTouchStart={(e: React.TouchEvent) => {
touchStartPosX.current = e.changedTouches[0].screenX;
touchStartPosY.current = e.changedTouches[0].screenY;
}}
onTouchEnd={(e: React.TouchEvent) => {
swipeSection(
e.changedTouches[0].screenX,
e.changedTouches[0].screenY
);
}}
>
<SectionPaginationContainer />
<MultiSelectButtonWrapperStyled isMultiSelect={isMultiSelect}>
<MultiSelectButton
theme={isMultiSelect ? "fill" : "line"}
text="다중 선택 모드"
onClick={toggleMultiSelectMode}
/>
</MultiSelectButtonWrapperStyled>
<CabinetListWrapperStyled>
<CabinetListContainer isAdmin={true} />

<RefreshButtonStyled
className="cabiButton"
title="새로고침"
id="refreshButton"
onClick={refreshCabinetList}
>
새로고침
</RefreshButtonStyled>
</CabinetListWrapperStyled>
</WrapperStyled>
</>
<RefreshButtonStyled
className="cabiButton"
title="새로고침"
id="refreshButton"
onClick={refreshCabinetList}
>
새로고침
</RefreshButtonStyled>
</CabinetListWrapperStyled>
</WrapperStyled>
);
};

Expand Down

0 comments on commit 1b07448

Please sign in to comment.