Skip to content

Commit

Permalink
[FE-Release] v0.3.1 배포
Browse files Browse the repository at this point in the history
  • Loading branch information
startartart authored Aug 27, 2023
2 parents c434421 + 733d384 commit b6ecd3f
Show file tree
Hide file tree
Showing 70 changed files with 1,141 additions and 706 deletions.
2 changes: 1 addition & 1 deletion FE-MyCarMaster/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/my-car.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>마이 카마스터</title>
</head>
Expand Down
9 changes: 9 additions & 0 deletions FE-MyCarMaster/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions FE-MyCarMaster/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@types/node": "^20.5.1",
"qrcode.react": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.14.2",
Expand Down
9 changes: 9 additions & 0 deletions FE-MyCarMaster/public/my-car.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: 0 additions & 1 deletion FE-MyCarMaster/public/vite.svg

This file was deleted.

2 changes: 2 additions & 0 deletions FE-MyCarMaster/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
Quotation,
WrittenQuotation,
ConsultComplete,
Admin,
} from "@pages/index";
import ErrorBoundary from "./components/common/ErrorBoundary/ErrorBoundary";
import { useFonts } from "@hooks/useFonts";
Expand Down Expand Up @@ -70,6 +71,7 @@ function App() {
element={<WrittenQuotation />}
/>
<Route path="/consult-complete" element={<ConsultComplete />} />
<Route path="/admin" element={<Admin />} />
</Routes>
</Flex>
</ErrorBoundary>
Expand Down
Binary file added FE-MyCarMaster/src/assets/icons/Loading.png
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 FE-MyCarMaster/src/assets/icons/Setting.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions FE-MyCarMaster/src/assets/icons/UnderBar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified FE-MyCarMaster/src/assets/images/FindCarmasterTooltip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions FE-MyCarMaster/src/components/Admin/AdminView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import { useState } from "react";
import { Flex } from "@styles/core.style";
import theme from "@styles/Theme";
import {
ClientBox,
QuotationBox,
ClientBoxText,
QuotationLookBox,
QuotationIFrame,
ClientQuotationDetailBox,
} from "./style";

type ClientType = {
id: number;
estimateUrl: string;
client: {
name: string;
phone: string;
email: string;
};
};

type AdminViewProps = {
clientList: ClientType[];
};

export default function AdminView({ clientList }: AdminViewProps) {
const [isQuotationUrl, setIsQuotationUrl] = useState<string | null>(null);
const [clientId, setClientId] = useState<number>(0);
const handleQuotationUrl = (url: string, id: number) => {
setIsQuotationUrl(url);
setClientId(id);
};
return (
<QuotationBox>
{isQuotationUrl === null && (
<Flex
$flexDirection="row"
$wrap={true}
$alignContent="flex-start"
$gap="1rem"
>
{clientList &&
clientList.map((client, index) => (
<ClientBox
key={index}
$justifyContent="center"
$alignItems="center"
onClick={() => handleQuotationUrl(client.estimateUrl, index)}
>
<Flex $flexDirection="column" $gap="0.5rem">
<ClientBoxText $font={theme.fonts.Medium15}>
이름 : {client.client.name.slice(0, 1)}**
</ClientBoxText>
<ClientBoxText $font={theme.fonts.Regular10}>
전화번호 : {client.client.phone.slice(0, 9)}****
</ClientBoxText>
<ClientBoxText $font={theme.fonts.Regular10}>
이메일 : {client.client.email}
</ClientBoxText>
</Flex>
</ClientBox>
))}
</Flex>
)}

{isQuotationUrl && (
<>
<ClientQuotationDetailBox
$flexDirection="column"
$position="absolute"
>
<ClientBoxText
$font={theme.fonts.Medium10}
$color={theme.colors.SMOOTH_RED}
$isHover={true}
onClick={() => setIsQuotationUrl(null)}
>
돌아가려면 클릭해주세요.
</ClientBoxText>
<ClientBoxText $font={theme.fonts.Medium15}>
이름 : {clientList[clientId].client.name}
</ClientBoxText>
<ClientBoxText $font={theme.fonts.Regular10}>
전화번호 : {clientList[clientId].client.phone}
</ClientBoxText>
<ClientBoxText $font={theme.fonts.Regular10}>
이메일 : {clientList[clientId].client.email}
</ClientBoxText>
</ClientQuotationDetailBox>

<QuotationLookBox>
{/* client.estimateUrl에 해당하는 견적서를 보여주는 페이지 */}
<QuotationIFrame src={isQuotationUrl} title="견적서" />
</QuotationLookBox>
</>
)}
</QuotationBox>
);
}
77 changes: 77 additions & 0 deletions FE-MyCarMaster/src/components/Admin/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import styled from "styled-components";

import { Flex, Text, TextProps } from "@styles/core.style";

export const QuotationBox = styled(Flex)`
width: 100%;
height: 100%;
`;
export const ClientBox = styled(Flex)`
width: 20rem;
height: 10rem;
background-color: ${(props) => props.theme.colors.WHITE};
padding: 2.5rem;
margin: 2rem;
border-radius: 1rem;
box-shadow: 0 0 0.5rem 0.1rem rgba(0, 0, 0, 0.1);
animation: showAdminText 0.1s ease-in-out;
@keyframes showAdminText {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
&:hover {
cursor: pointer;
box-shadow: 0 0 0.5rem 0.1rem rgba(0, 0, 0, 0.3);
}
`;

interface ClientTextProps extends TextProps {
$isHover?: boolean | null;
}

export const ClientBoxText = styled(Text)<ClientTextProps>`
text-align: left;
width: 100%;
// underline
&:hover {
text-decoration: ${(props) => (props.$isHover ? "underline" : "none")};
cursor: ${(props) => (props.$isHover ? "pointer" : "default")};
}
`;

export const QuotationLookBox = styled(Flex)`
width: 100%;
height: 100%;
`;

export const QuotationIFrame = styled.iframe`
width: 100%;
height: 100%;
border: none;
border-radius: 1rem;
box-shadow: 0 0 0.5rem 0.1rem rgba(0, 0, 0, 0.1);
`;

export const ClientQuotationDetailBox = styled(Flex)`
width: 20rem;
height: auto;
position: absolute;
gap: 1rem;
top: 0;
left: 0;
background-color: ${(props) => props.theme.colors.WHITE};
padding: 2.5rem;
border-radius: 0 0 2rem 0;
&:hover {
box-shadow: 0 0 0.5rem 0.1rem rgba(0, 0, 0, 0.3);
}
`;
41 changes: 41 additions & 0 deletions FE-MyCarMaster/src/components/Footer/FoldScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useTrimState, useTrimDispatch } from "@contexts/TrimContext";
import { useQuotationDispatch } from "@contexts/QuotationContext";
import { SnackBar, Modals } from "@common/index";
import { ModalType } from "@constants/Modal.constants";
import SearchTrimTooltip from "@assets/images/SearchTrimTooltip.png";

type FoldScreenProps = {
text: string;
Expand Down Expand Up @@ -118,6 +119,10 @@ export default function FoldScreen({ text, $switch }: FoldScreenProps) {
? "원하는 기능을 선택하시면 해당 기능이 포함된 트림을 추천해드려요!"
: "추가 옵션 선택하러 가기"}
</Text>
<ToolTip
src={SearchTrimTooltip}
$showTooltip={!isFold && $switch === "searchTrim"}
/>

{!isFold && $switch === "searchTrim" && <Bar $show={loading} />}
{$switch === "searchTrim" ? (
Expand Down Expand Up @@ -317,3 +322,39 @@ const ButtonContainer = styled.div<{ $style: boolean }>`
}
}
`;

const ToolTip = styled.img<{ $showTooltip: boolean }>`
display: ${({ $showTooltip }) => ($showTooltip ? "block" : "none")};
position: absolute;
top: 60%;
right: -15rem;
transform: translateY(-50%);
width: 15rem;
height: auto;
animation: ${({ $showTooltip }) =>
$showTooltip
? "fadeInToolTip 0.5s ease-in-out"
: "fadeOutToolTip 0.5s ease-in-out"};
@keyframes fadeInToolTip {
0% {
opacity: 0;
right: -15rem;
}
100% {
opacity: 1;
right: -15rem;
}
}
@keyframes fadeOutToolTip {
0% {
opacity: 1;
right: -15rem;
}
100% {
opacity: 0;
right: -15rem;
}
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const PageButtonContainer = styled.div`
width: 80%;
text-align: center;
gap: 1rem;
${(props) => props.theme.fonts.Bold20};
${(props) => props.theme.fonts.Medium20};
color: ${({ theme }) => theme.colors.NAVYBLUE5};
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function InteriorColorSelectView() {
name: exteriorList[index].name,
price: exteriorList[index].price,
imgUrl: exteriorList[index].colorImgUrl,
coloredImgUrl: exteriorList[index].coloredImgUrl,
},
});
carPaintDispatch({
Expand Down
13 changes: 13 additions & 0 deletions FE-MyCarMaster/src/components/Footer/view/OptionSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useEffect, useState } from "react";
import { Tooltip } from "@/styles/core.style";
import { BlurFlex, OptionFlex, ScrollButton } from "./style";
import { useOptionDispatch, useOptionState } from "@contexts/OptionContext";
import { useQuotationState } from "@contexts/QuotationContext";
Expand All @@ -8,11 +9,13 @@ import filterOptionCategory from "@utils/Option/filterOptionCategory";
import { OptionType } from "types/options.types";
import ArrowRightLong from "@assets/icons/ArrowRightLong.svg";
import ArrowLeftLong from "@assets/icons/ArrowLeftLong.svg";
import TryConsiderTooltip from "@assets/images/TryConsiderTooltip.png";

export default function OptionSelect() {
const { optionList, selectedOption, consideredOption, optionCategoryId } =
useOptionState();
const [isTrimCheckOption, setIsTrimCheckOption] = useState<boolean>(false);
const [isTooltipOpen, setIsTooltipOpen] = useState<boolean>(true);
const { optionQuotation } = useQuotationState();
// const [current, setCurrent] = useState<number>(0);
const optionDispatch = useOptionDispatch();
Expand Down Expand Up @@ -47,6 +50,7 @@ export default function OptionSelect() {
}, [optionQuotation.selectedQuotation, optionDispatch]);

const changeOptionId = (index: number) => {
setIsTooltipOpen(false);
optionDispatch({
type: "SET_OPTION_ID",
payload: {
Expand Down Expand Up @@ -99,6 +103,15 @@ export default function OptionSelect() {
);
})}
</OptionFlex>
{isTooltipOpen && (
<Tooltip
$width="30%"
$height="auto"
$top="80%"
$left="0"
src={TryConsiderTooltip}
/>
)}
<ScrollButton
$direction="left"
onClick={() => handleScrollButton("left")}
Expand Down
Loading

0 comments on commit b6ecd3f

Please sign in to comment.