-
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.
Merge pull request #61 from SWM-FIRE/FIRE-327-fe-유저목록-및-스크린쉐어-위치에-아바타…
…-적절히-배치 FIRE-327-fe-유저목록-및-스크린쉐어-위치에-아바타-적절히-배치
- Loading branch information
Showing
6 changed files
with
127 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,53 @@ | ||
import { useEffect } from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import styled from 'styled-components'; | ||
import mockPeople from '../../mockPoeple.json'; | ||
import SingleScreen from './SingleScreen'; | ||
|
||
export default function ScreenShare() { | ||
return <Component>1</Component>; | ||
const navigate = useNavigate(); | ||
useEffect(() => { | ||
if (!localStorage.getItem('uid') || !localStorage.getItem('nickname')) { | ||
alert('로그인 후 이용해주세요'); | ||
navigate('/main'); | ||
} | ||
}, []); | ||
return ( | ||
<Container> | ||
<ScreenWrapper> | ||
<SingleScreen | ||
nickname={localStorage.getItem('nickname')} | ||
avatar={localStorage.getItem('avatar')} | ||
/> | ||
{mockPeople.people.map((person) => ( | ||
<SingleScreen | ||
key={person.nickname} | ||
nickname={person.nickname} | ||
avatar={person.avatar} | ||
/> | ||
))} | ||
</ScreenWrapper> | ||
</Container> | ||
); | ||
} | ||
|
||
const Component = styled.div` | ||
padding: 5.6rem 2.5rem; | ||
const ScreenWrapper = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
overflow: auto; | ||
@media (max-width: 900px) { | ||
flex-direction: column; | ||
flex-wrap: unset; | ||
gap: 10%; | ||
} | ||
gap: 0 8%; | ||
height: 100%; | ||
`; | ||
|
||
const Container = styled.div` | ||
margin: 3rem 0 0 1.6rem; | ||
width: calc(100% - 46.5rem); | ||
height: calc(100% - 5rem); | ||
`; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import styled from 'styled-components'; | ||
import MyAvatar from '../../assets/avatar/MyAvatar'; | ||
|
||
export default function SingkleScreen({ | ||
nickname, | ||
avatar, | ||
}: { | ||
nickname: string; | ||
avatar: string; | ||
}) { | ||
return ( | ||
<Screen> | ||
<AvatarPosition> | ||
<MyAvatar num={Number(avatar)} /> | ||
<NameContainer>{nickname}</NameContainer> | ||
</AvatarPosition> | ||
</Screen> | ||
); | ||
} | ||
|
||
const NameContainer = styled.div` | ||
padding: 1%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: 1.6rem; | ||
font-family: IBMPlexSansKRRegular; | ||
color: #f9fafb; | ||
`; | ||
|
||
const AvatarPosition = styled.div` | ||
bottom: calc(-5% - 4rem); | ||
height: calc(10% + 6rem); | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
svg { | ||
height: 100%; | ||
} | ||
position: absolute; | ||
`; | ||
|
||
const Screen = styled.div` | ||
background-color: #4a4a4a; | ||
display: flex; | ||
justify-content: center; | ||
@media (max-width: 900px) { | ||
width: 60%; | ||
height: 0; | ||
padding-bottom: 38%; | ||
} | ||
width: 36%; | ||
height: 0; | ||
border-radius: 1rem; | ||
padding-bottom: 22%; | ||
position: relative; | ||
`; |
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 @@ | ||
{ | ||
"roomName": "영기의 테스트방", | ||
"current": 3, | ||
"total": 4, | ||
"people": [ | ||
{ | ||
"nickname": "groot", | ||
"avatar": "10" | ||
}, | ||
{ | ||
"nickname": "halang", | ||
"avatar": "27" | ||
} | ||
] | ||
} |
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,6 @@ | ||
{ | ||
"roomName": "영기의 테스트방", | ||
"current": 3, | ||
"total": 4, | ||
"people": [] | ||
} |
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
c92966b
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.
Successfully deployed to the following URLs:
modoco-frontend – ./
modoco-frontend-git-main-071yoon.vercel.app
modoco-frontend.vercel.app
modocode.com
modoco-frontend-071yoon.vercel.app