-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
1,141 additions
and
706 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.