Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/SP1' into SP1/#566-cart-…
Browse files Browse the repository at this point in the history
…page-api
  • Loading branch information
gunom committed Dec 4, 2023
2 parents f231da2 + c6517ec commit 8e2ffe6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 58 deletions.
6 changes: 6 additions & 0 deletions src/assets/icon/ic_cart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/icon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export { ReactComponent as IcBtnStepperPlusDark } from './ic_btn_plus_dark.svg';
export { ReactComponent as IcBtnStepperMinusLight } from './ic_btn_minus_light.svg';
export { ReactComponent as IcBtnStepperMinusDark } from './ic_btn_minus_dark.svg';
export { ReactComponent as ImgWelcomeLogo } from './img_welcome_logo.svg';
export { ReactComponent as IcCart } from './ic_cart.svg';

// brush
export { ReactComponent as IcBrushBoldSelected } from './ic_brush_bold_selected.svg';
Expand Down
9 changes: 8 additions & 1 deletion src/common/SideMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { styled } from 'styled-components';
import { IcCustom, IcShop, IcMy } from '../assets/icon';
import { IcCustom, IcShop, IcMy, IcCart } from '../assets/icon';
import { useEffect } from 'react';
import SideMenuUserInfo from './SideMenuUserInfo';
import { useNavigate } from 'react-router-dom';
Expand Down Expand Up @@ -44,6 +44,13 @@ const SideMenu = ({ isSideMenuOpen, setIsSideMenuOpen }: SideMenuProps) => {
text: '내 타투',
clickHandler: handleClickMyTattooButton,
},
{
icon: <IcCart />,
text: '장바구니',
clickHandler: () => {
navigate('/cart');
},
},
];

useEffect(() => {
Expand Down
56 changes: 0 additions & 56 deletions src/common/UserInfoSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ const UserInfoSection = () => {
{response?.homeUserInfo.name}
<span></span>
</St.SideMenuUserName>
<St.SideMenuUserPointWrapper>
<St.SideMenuUserPointTitle>보유 포인트</St.SideMenuUserPointTitle>
<St.SideMenuUserPointTextWrapper>
<St.SideMenuUserPoint>
{response?.homeUserInfo.point.toLocaleString()}
</St.SideMenuUserPoint>
<span>P</span>
</St.SideMenuUserPointTextWrapper>
<St.SideMenuUserPointChargeButton onClick={handleClickChargeBtn}>
충전하기
</St.SideMenuUserPointChargeButton>
</St.SideMenuUserPointWrapper>
</St.SideMenuUserInfoSection>
)
);
Expand Down Expand Up @@ -66,50 +54,6 @@ const St = {
color: ${({ theme }) => theme.colors.gray2};
}
`,

SideMenuUserPointWrapper: styled.article`
display: flex;
flex-direction: column;
margin: 2.8rem 0 3.6rem 3rem;
`,

SideMenuUserPointTextWrapper: styled.div`
display: flex;
align-items: center;
flex-direction: row;
margin-top: 0.5rem;
& > span {
margin-left: 0.4rem;
font: ${({ theme }) => theme.fonts.title_semibold_20};
color: ${({ theme }) => theme.colors.gray2};
}
`,

SideMenuUserPointTitle: styled.h2`
font: ${({ theme }) => theme.fonts.detail_medium_12};
color: ${({ theme }) => theme.colors.gray2};
`,

SideMenuUserPoint: styled.p`
font: ${({ theme }) => theme.fonts.title_semibold_24};
color: ${({ theme }) => theme.colors.white};
`,

SideMenuUserPointChargeButton: styled.button`
width: 7.9rem;
height: 3.1rem;
margin-top: 1.4rem;
padding: 0;
background-color: ${({ theme }) => theme.colors.bg};
border-radius: 0.5rem;
font: ${({ theme }) => theme.fonts.title_semibold_16};
color: ${({ theme }) => theme.colors.gray8};
`,
};

export default UserInfoSection;
2 changes: 1 addition & 1 deletion src/libs/hooks/useGetUserProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { AxiosError } from "axios";
export interface UserProfileProps {
homeUserInfo: {
name: string;
point: number;
}
}

Expand All @@ -24,6 +23,7 @@ const useGetUserProfile = () => {
await api.get('/user/profile')
.then(res => {
const data: UserProfileResponse = res.data;
console.log(data.data);
setResponse(data.data);
})
.catch(err => {
Expand Down

0 comments on commit 8e2ffe6

Please sign in to comment.