-
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 #40 from SWM-FIRE/FIRE-290-fe-리팩토링
FIRE-290-fe-리팩토링
- Loading branch information
Showing
10 changed files
with
193 additions
and
126 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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,60 @@ | ||
import styled from 'styled-components'; | ||
import UserStore from '../../stores/userStore'; | ||
import MyAvatar from '../../assets/avatar/MyAvatar'; | ||
|
||
export default function Header() { | ||
const { nickname, avatar } = UserStore(); | ||
return ( | ||
<Container> | ||
<Logo>modoco</Logo> | ||
<Profile> | ||
<AvatarContainer> | ||
<MyAvatar num={avatar} /> | ||
</AvatarContainer> | ||
{nickname} | ||
</Profile> | ||
</Container> | ||
); | ||
} | ||
|
||
const Logo = styled.div` | ||
font-size: 2.4rem; | ||
position: absolute; | ||
width: 9.2rem; | ||
height: 2.2rem; | ||
font-family: PretendardRegular, Arial; | ||
color: white; | ||
left: 4rem; | ||
`; | ||
|
||
const AvatarContainer = styled.div` | ||
height: 4rem; | ||
svg { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
`; | ||
|
||
const Profile = styled.div` | ||
right: 4rem; | ||
position: absolute; | ||
height: 4rem; | ||
width: 9rem; | ||
border-radius: 4.8rem; | ||
display: flex; | ||
justify-content: center; | ||
gap: 1rem; | ||
align-items: center; | ||
font-family: IBMPlexSansKRRegular; | ||
font-size: 1.5rem; | ||
color: white; | ||
`; | ||
|
||
const Container = styled.div` | ||
width: 100vw; | ||
height: 10rem; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
border-bottom: solid #2b2e41 0.1rem; | ||
`; |
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,28 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { ScrollMenu } from 'react-horizontal-scrolling-menu'; | ||
import Blocks from './Blocks'; | ||
|
||
export default function Scrolls() { | ||
return ( | ||
<Container> | ||
<ScrollMenu> | ||
<Blocks /> | ||
</ScrollMenu> | ||
</Container> | ||
); | ||
} | ||
const Container = styled.div` | ||
margin-top: 3.6rem; | ||
width: calc(100% - 10rem); | ||
overflow: hidden; | ||
.react-horizontal-scrolling-menu--scroll-container::-webkit-scrollbar { | ||
display: none; | ||
} | ||
.react-horizontal-scrolling-menu--scroll-container { | ||
-ms-overflow-style: none; /* IE and Edge */ | ||
scrollbar-width: none; /* Firefox */ | ||
} | ||
align-self: start; | ||
margin-left: 10rem; | ||
`; |
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,69 @@ | ||
import { useNavigate } from 'react-router-dom'; | ||
import styled from 'styled-components'; | ||
import vectors from '../atoms/Vectors'; | ||
import Search from './Search'; | ||
import PositionInterface from '../../interface/position.interface'; | ||
|
||
export default function TitleContainer() { | ||
const navigate = useNavigate(); | ||
const randomEnter = () => { | ||
navigate(`/room/random`); | ||
}; | ||
|
||
return ( | ||
<Container> | ||
<Vector src={vectors.Circle} left={15} top={61} size={7} /> | ||
<Vector src={vectors.Z} left={10} top={23} size={11} /> | ||
<Vector src={vectors.Triangle} left={85} top={18} size={10} /> | ||
<Vector src={vectors.Plus} left={84} top={58} size={11} /> | ||
<TitleFlex> | ||
<Title color="ffffff">모여서</Title> | ||
<Title color="96CEB4">도란도란</Title> | ||
</TitleFlex> | ||
<Title color="ffffff">코딩해요</Title> | ||
<Search /> | ||
<RandomEnter onClick={randomEnter}>랜덤 입장</RandomEnter> | ||
</Container> | ||
); | ||
} | ||
|
||
const RandomEnter = styled.button` | ||
width: 16.1rem; | ||
height: 5.4rem; | ||
background-color: white; | ||
margin-top: 4rem; | ||
border-radius: 6.2rem; | ||
cursor: pointer; | ||
color: black; | ||
font-size: 1.8rem; | ||
font-family: JostRegular; | ||
font-weight: 700; | ||
`; | ||
|
||
const Container = styled.div` | ||
margin-top: 6rem; | ||
width: 62rem; | ||
height: 35rem; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
`; | ||
|
||
const Title = styled.h1<{ color: string }>` | ||
font-family: GmarketSansTTFBold; | ||
margin-left: 2rem; | ||
font-size: 7.2rem; | ||
align-self: center; | ||
color: #${(props) => props.color}; | ||
`; | ||
|
||
const Vector = styled.img<PositionInterface>` | ||
position: absolute; | ||
width: ${(props) => props.size}rem; | ||
left: ${(props) => props.left}%; | ||
top: ${(props) => props.top}%; | ||
`; | ||
|
||
const TitleFlex = styled.div` | ||
display: flex; | ||
`; |
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 @@ | ||
export default interface Position { | ||
size?: number; | ||
left?: number; | ||
top: number; | ||
right?: number; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
import create from 'zustand'; | ||
|
||
interface User { | ||
avatar: number; | ||
nickname: string; | ||
uid: string; | ||
setNickname: (_by: string) => void; | ||
setUid: (_by: string) => void; | ||
setAvatar: (_by: number) => void; | ||
} | ||
const UserStore = create<User>((set) => ({ | ||
nickname: '', | ||
uid: '', | ||
avatar: 1, | ||
setNickname: (by) => { | ||
set(() => ({ nickname: by })); | ||
}, | ||
setUid: (by) => { | ||
set(() => ({ uid: by })); | ||
}, | ||
setAvatar: (by) => { | ||
set(() => ({ avatar: by })); | ||
}, | ||
})); | ||
|
||
export default UserStore; |
56cca9b
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.vercel.app
modoco-frontend-071yoon.vercel.app
modoco-frontend-git-main-071yoon.vercel.app