Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…N-WEB-ALADIN into feat/#30/headerAndDropDown
  • Loading branch information
ocahs9 committed Nov 22, 2024
2 parents 4ad80f0 + 2bec15a commit bf19438
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ dist-ssr
!.yarn/sdks
!.yarn/versions

install-state.gz
install-state.gz
tsconfig.node.tsbuildinfo
tsconfig.tsbuildinfo
vite.config.d.ts
vite.config.js
Binary file modified .yarn/install-state.gz
Binary file not shown.
10 changes: 10 additions & 0 deletions src/components/Cart/CartSmallBtn/CartSmallBtn.styled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import styled from "@emotion/styled";
import theme from "@styles/theme";

export const StyledBtn = styled.button`
text: ${theme.colors.text_gray40};
border: 1px solid ${theme.colors.stroke_gray50};
${theme.fonts.body10_sb_11};
padding: 0.4rem 0.6rem;
border-radius: 0.5rem;
`;
15 changes: 15 additions & 0 deletions src/components/Cart/CartSmallBtn/CartSmallBtn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as S from "./CartSmallBtn.styled"

interface CartSmallBtnProps {
text: string;
}

const CartSmallBtn = ( {text} : CartSmallBtnProps ) => {
return (
<S.StyledBtn>
{text}
</S.StyledBtn>
)
}

export default CartSmallBtn;
23 changes: 23 additions & 0 deletions src/components/Cart/OrderBtn/OrderBtn.styled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import styled from "@emotion/styled";
import theme from "@styles/theme";

export const StyledBtn = styled.button`
background-color: ${theme.colors.purple50};
border-radius: 10px;
color: white;
${theme.fonts.body2_b_14};
width: 25rem;
height: 5.6rem;
transition:
background-color 0.3s ease,
color 0.3s ease,
width 0.3s ease,
height 0.3s ease;
&:active {
background-color: ${theme.colors.purple60};
color: ${theme.colors.purple40};
width: 23.6rem;
height: 5.2rem;
}
`;
16 changes: 16 additions & 0 deletions src/components/Cart/OrderBtn/OrderBtn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as S from "./OrderBtn.styled"

interface OrderBtnProps {
totalItems: number;
totalPrice: number;
}

const OrderBtn = ({ totalItems, totalPrice } : OrderBtnProps) => {
return (
<S.StyledBtn>
{`${totalPrice.toLocaleString()}원 (${totalItems}) 주문하기`}
</S.StyledBtn>
);
};

export default OrderBtn;
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noFallthroughCasesInSwitch": true
},
"include": ["src", "src/svg.d.ts"],
Expand Down
22 changes: 11 additions & 11 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';

// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: [
{ find: "@assets", replacement: "/src/assets" },
{ find: "@pages", replacement: "/src/pages" },
{ find: "@components", replacement: "/src/components" },
{ find: "@styles", replacement: "/src/styles" },
{ find: "@constants", replacement: "/src/constants" },
{ find: "@hooks", replacement: "/src/hooks" },
{ find: "@utils", replacement: "/src/utils" },
{ find: "@apis", replacement: "/src/apis" },
{ find: '@assets', replacement: '/src/assets' },
{ find: '@pages', replacement: '/src/pages' },
{ find: '@components', replacement: '/src/components' },
{ find: '@styles', replacement: '/src/styles' },
{ find: '@constants', replacement: '/src/constants' },
{ find: '@hooks', replacement: '/src/hooks' },
{ find: '@utils', replacement: '/src/utils' },
{ find: '@apis', replacement: '/src/apis' },
],
},
})
});

0 comments on commit bf19438

Please sign in to comment.