-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Hotfix: zustand 최신화 닉네임 변경 수정 * Feat: File 올리기 API 확인 필요 * Feat: Toast 디자인 완성 * Feat: 누르면 뜨게 설정 모션필요 * Feat: 토스트 위치 설정
- Loading branch information
Showing
9 changed files
with
302 additions
and
81 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import styled from "@emotion/styled" | ||
import GoogleOneSVG from "../assets/GoogleOne.svg" | ||
import { Button } from "./common/Button" | ||
|
||
export const Toast = ({ found, points, handleClickUpload, handleGoto }) => { | ||
|
||
return( | ||
<ToastWrappaer> | ||
<Left> | ||
<img src={GoogleOneSVG} alt="GoogleOneSVG"/> | ||
</Left> | ||
<MainContent> | ||
<MainText> | ||
<em>I found {found}!</em> | ||
<p>My score is {points}</p> | ||
</MainText> | ||
|
||
<Button.Wrapper> | ||
<Button.setButton text="Upload" buttonType="secondary" onClick={handleClickUpload}/> | ||
<Button.setButton text="Collection" buttonType="primary" onClick={handleGoto}/> | ||
</Button.Wrapper> | ||
</MainContent> | ||
|
||
</ToastWrappaer> | ||
) | ||
} | ||
|
||
const ToastWrappaer = styled.section` | ||
position: absolute; | ||
bottom: 2rem; | ||
right: 2rem; | ||
z-index: 1000; | ||
display: flex; | ||
width: 22.4375rem; | ||
align-items: center; | ||
flex-shrink: 0; | ||
border-radius: 0.5rem; | ||
border: 1px solid #E8EAED; | ||
box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.20); | ||
transition: right 0.3s ease; | ||
` | ||
const Left = styled.section` | ||
display: flex; | ||
padding: 4.3125rem 1.75rem; | ||
align-items: flex-start; | ||
gap: 0.5rem; | ||
flex-shrink: 0; | ||
border-right: 1px solid #E8EAED; | ||
background: var(----white-color, #FFF); | ||
img { | ||
width: 2rem; | ||
height: 2rem; | ||
flex-shrink: 0; | ||
} | ||
` | ||
|
||
const MainContent = styled.section` | ||
display: flex; | ||
width: 16.875rem; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 2.125rem; | ||
flex-shrink: 0; | ||
align-self: stretch; | ||
background: var(----white-color, #FFF); | ||
box-sizing: border-box; | ||
padding: 1rem; | ||
` | ||
const MainText = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 0.25rem; | ||
align-self: stretch; | ||
em { | ||
color: #3C4043; | ||
font-family: Roboto; | ||
font-size: 0.875rem; | ||
font-weight: 600; | ||
line-height: 1.6875rem; /* 192.857% */ | ||
letter-spacing: 0.00438rem; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
p { | ||
color: #5F6368; | ||
font-family: Roboto; | ||
font-size: 0.875rem; | ||
font-weight: 400; | ||
line-height: 1.1875rem; /* 135.714% */ | ||
letter-spacing: 0.00438rem; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
` |
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,48 @@ | ||
import styled from "@emotion/styled" | ||
|
||
export const Button = { | ||
Wrapper: ({ children }) => { | ||
return(<ButtonWrapper>{children}</ButtonWrapper>) | ||
}, | ||
|
||
setButton: ({ text, buttonType, onClick } : { text: string, buttonType: string, onClick: () => void })=> { | ||
switch (buttonType) { | ||
case "primary": | ||
return <ButtonType buttonType="primary" onClick={onClick}>{text}</ButtonType>; | ||
case "secondary": | ||
return <ButtonType buttonType="secondary" onClick={onClick}>{text}</ButtonType>; | ||
default: | ||
return null; // or handle other cases as needed | ||
} | ||
} | ||
} | ||
|
||
|
||
const ButtonWrapper = styled.div` | ||
display: flex; | ||
justify-content: flex-end; | ||
align-items: center; | ||
gap: 0.25rem; | ||
align-self: stretch; | ||
` | ||
|
||
const ButtonType = styled.button<{ buttonType: string }>` | ||
display: flex; | ||
width: 6rem; | ||
height: 2.25rem; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 0.5rem; | ||
border-radius: 0.25rem; | ||
border: 1px solid var(----googleblue-color, #4285F4); | ||
/* Use conditional styling based on the type prop */ | ||
background-color: ${(props) => (props.buttonType === 'primary' ? '#1A73E8' : '#ffffff')}; | ||
color: ${(props) => (props.buttonType === 'primary' ? '#ffffff' : '#5F6368')}; | ||
font-family: Roboto; | ||
font-size: 0.875rem; | ||
font-style: normal; | ||
font-weight: 500; | ||
line-height: normal; | ||
`; |
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.