Skip to content

Commit

Permalink
Merge pull request #1693 from innovationacademy-kr/fe/dev/bug_scrollb…
Browse files Browse the repository at this point in the history
…ar_error/#1669

[FE] FIX: 새로고침 버튼 누를 때 나타나는 스크롤바 제거
  • Loading branch information
jihyunk03 authored Oct 18, 2024
2 parents 3f1481f + 08660f1 commit 01136bf
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 01136bf

Please sign in to comment.