Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[혜택관리] 혜택 문구 추가, 수정 기능 추가 #72

Merged
merged 6 commits into from
Dec 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: 혜택 관리 페이지 테이블 뷰로 변경
chaeseungyun committed Dec 17, 2024
commit 266b337bbe7570eec5bed419c66ba5fc6edb3d99
45 changes: 25 additions & 20 deletions src/pages/Services/Benefit/index.style.tsx
Original file line number Diff line number Diff line change
@@ -33,32 +33,37 @@ export const Wrapper = styled.div`

`;

export const ShopContainer = styled.div`
export const Row = styled.tr<{ isclicked: boolean }>`
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
grid-template-rows: repeat(auto-fill, 80px);
place-items: center;
grid-template-columns: 40% 60%;
cursor: pointer;
width: 100%;
height: 50px;
border: ${(props) => (props.isclicked ? '1px solid rgba(129, 173, 255, 0.8) ' : '1px solid #f0f0f0')};
`;

export const Button = styled.button<{ isclicked: boolean }>`
cursor: pointer;
width: 150px;
export const HeaderRow = styled.tr`
display: grid;
grid-template-columns: 40% 60%;
width: 100%;
height: 50px;
background: #fff;
text-align: center;
transition: scale 0.2s;
border: ${(props) => (props.isclicked ? '4px solid rgba(129, 173, 255, 0.8) ' : 'none')};
border-radius: 10px;
border: 1px solid #f0f0f0;
`;

export const HeaderItem = styled.th`
padding: 15px;
`;

export const TitleItem = styled.td`
padding: 15px;
`;

&:active {
scale: 0.95;
}
export const DetailItem = styled.td`
padding: 15px;
`;

export const ShopListContainer = styled.div`
background: #ddd;
padding: 25px;
height: 60%;
export const ShopList = styled.table`
width: 100%;
overflow-y: auto;
border-spacing: 0 10px;
border-collapse: collapse;
`;
30 changes: 21 additions & 9 deletions src/pages/Services/Benefit/index.tsx
Original file line number Diff line number Diff line change
@@ -141,21 +141,33 @@ export default function BenefitPage() {
</CustomForm.Modal>
</S.ButtonContainer>
</S.SideContainer>
<S.ShopListContainer>
{selected ? (
<S.ShopContainer>
{selected ? (
<S.ShopList>
<thead>
<S.HeaderRow>
<S.HeaderItem>상점명</S.HeaderItem>
<S.HeaderItem>상세정보</S.HeaderItem>
</S.HeaderRow>
</thead>
<tbody>
{data?.shops.map((shop) => (
<S.Button
<S.Row
isclicked={selectedShop.includes(shop.id)}
onClick={() => onShopClick(shop.id)}
key={shop.id}
>
{shop.name}
</S.Button>
<S.TitleItem>
{shop.name}
</S.TitleItem>
<S.DetailItem>
{shop.detail}
</S.DetailItem>
</S.Row>
))}
</S.ShopContainer>
) : null}
</S.ShopListContainer>
</tbody>
</S.ShopList>

) : null}
</S.Container>
</S.Wrapper>
);