Skip to content

Commit

Permalink
chore: 프로필 탭의 모든 요소가 드래그 할 수 없도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
chysis committed Dec 27, 2024
1 parent 799d3d6 commit 86806d1
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions frontend/src/components/profile/ProfileTab/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import UndraggableWrapper from '@/components/common/UndraggableWrapper';
import { ProfileTabElement } from '@/types/profile';

import * as S from './styles';
Expand All @@ -9,33 +10,35 @@ interface ProfileTabProps {
const ProfileTab = ({ items }: ProfileTabProps) => {
return (
<S.ProfileTabContainer>
{items.map((item, index) => {
switch (item.elementType) {
case 'readonly':
return (
<S.ReadonlyItemWrapper
key={`${item.elementType}_${index}`}
$isDisplayedOnlyMobile={item.isDisplayedOnlyMobile}
>
{item.content}
</S.ReadonlyItemWrapper>
);
case 'action':
return (
<S.ActionItemWrapper
key={`${item.elementType}_${index}`}
onClick={item.handleClick}
$isDisplayedOnlyMobile={item.isDisplayedOnlyMobile}
>
{item.content}
</S.ActionItemWrapper>
);
case 'divider':
return (
<S.Divider key={`${item.elementType}_${index}`} $isDisplayedOnlyMobile={item.isDisplayedOnlyMobile} />
);
}
})}
<UndraggableWrapper>
{items.map((item, index) => {
switch (item.elementType) {
case 'readonly':
return (
<S.ReadonlyItemWrapper
key={`${item.elementType}_${index}`}
$isDisplayedOnlyMobile={item.isDisplayedOnlyMobile}
>
{item.content}
</S.ReadonlyItemWrapper>
);
case 'action':
return (
<S.ActionItemWrapper
key={`${item.elementType}_${index}`}
onClick={item.handleClick}
$isDisplayedOnlyMobile={item.isDisplayedOnlyMobile}
>
{item.content}
</S.ActionItemWrapper>
);
case 'divider':
return (
<S.Divider key={`${item.elementType}_${index}`} $isDisplayedOnlyMobile={item.isDisplayedOnlyMobile} />
);
}
})}
</UndraggableWrapper>
</S.ProfileTabContainer>
);
};
Expand Down

0 comments on commit 86806d1

Please sign in to comment.