-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/share 결과 공유 페이지 #7
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,26 @@ | ||
import { AppBarProps } from "./AppBar"; | ||
import styled from "@emotion/styled"; | ||
|
||
export const AppBarElement = styled.span<AppBarProps>` | ||
position: relative; | ||
|
||
width: 100%; | ||
height: 60px; | ||
|
||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
box-sizing: border-box; | ||
|
||
border-bottom: 2px solid #0000001f; | ||
|
||
& > span { | ||
font-weight: 800; | ||
} | ||
|
||
& > img { | ||
position: absolute; | ||
left: 15px; | ||
} | ||
`; |
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,15 @@ | ||
import { forwardRef } from "react"; | ||
|
||
import { AppBarElement } from "./AppBar.style"; | ||
|
||
export interface AppBarProps extends React.ComponentProps<"div"> { | ||
children: React.ReactNode; | ||
} | ||
|
||
export const AppBar = forwardRef<HTMLDivElement, AppBarProps>(({ children, ...props }, ref) => { | ||
return ( | ||
<AppBarElement ref={ref} {...props}> | ||
{children} | ||
</AppBarElement> | ||
); | ||
}); | ||
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,45 @@ | ||
import { useEffect, useState } from "react"; | ||
|
||
import { AppBar } from "@/components/navigation/AppBar"; | ||
import { Text } from "@/components/typography/Text"; | ||
|
||
import BackIcon from "@/assets/back.svg"; | ||
import ShareIcon from "@/assets/shareLarge.svg"; | ||
|
||
import styled from "@emotion/styled"; | ||
|
||
const Header = styled.div` | ||
margin-top: 20px; | ||
margin-left: 30px; | ||
|
||
& > img { | ||
margin-bottom: 20px; | ||
} | ||
`; | ||
|
||
export default function ResultShare() { | ||
const [name, setName] = useState<string>(""); | ||
|
||
useEffect(() => { | ||
// 전역 상태에서 이름을 불러와서 setName으로 디스플레이 이름을 변경합니다. | ||
setName("홍길동"); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
{/* 나중에 통일된 Header||AppBar로 변경해도 됩니다. */} | ||
<AppBar> | ||
<img src={BackIcon} /> | ||
<Text size="m">결과 공유</Text> | ||
</AppBar> | ||
<Header> | ||
<img src={ShareIcon} /> | ||
<Text size="xl"> | ||
{name}님의 동BTI를 | ||
<br /> | ||
공유해보세요 | ||
</Text> | ||
</Header> | ||
</> | ||
); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forwardRef 는 리액트 노드의 ref 속성에 접근할때
예를들어 input, button 과 같은 경우에만 사용하면 될것 같습니다!
ref props 는 일반적인 props 와 다르게 React Fiber Node 에 저장되기 때문에 forwardRef 로 전달하는거에요!
그냥 styled component 를 사용하면 ref 도 자동으로 전달해주니 저런식으로 굳이 짤 필요는 없다고 생각됩니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이해됐습니다! 다음 PR과 함께 수정하겠습니다!