-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into SKRF-131-kakao-login-error
- Loading branch information
Showing
18 changed files
with
328 additions
and
16 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { END_POINTS } from '@/constants/api'; | ||
|
||
import { axiosClient } from '../axiosClient'; | ||
|
||
interface getMyClub { | ||
id: string; | ||
} | ||
interface Club { | ||
//추후 수정 필요 | ||
id: string; | ||
src: string; | ||
} | ||
|
||
const getMyClub = async ({ id }: getMyClub) => { | ||
const { data } = await axiosClient.get<Club[]>(END_POINTS.MY_CLUB, { params: { id } }); | ||
|
||
return data; | ||
}; | ||
|
||
export default getMyClub; |
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,38 @@ | ||
import Theme from '@/styles/Theme'; | ||
import styled from '@emotion/styled'; | ||
|
||
const SearchInputContainerStyled = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 60%; | ||
height: 100%; | ||
`; | ||
|
||
const SearchBarStyled = styled.div` | ||
display: flex; | ||
justify-content: start; | ||
align-items: center; | ||
width: 90%; | ||
height: 60%; | ||
border: 0.05rem solid ${Theme.color.lineColor}; | ||
border-radius: 1rem; | ||
`; | ||
|
||
const SearchInputStyled = styled.input` | ||
flex-grow: 1; | ||
height: 70%; | ||
margin: 0 1rem; | ||
outline: none; | ||
border: none; | ||
`; | ||
|
||
const IconContainerStyled = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin-right: 0.5rem; | ||
color: ${Theme.color.lineColor}; | ||
`; | ||
|
||
export { SearchInputContainerStyled, SearchBarStyled, SearchInputStyled, IconContainerStyled }; |
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,23 @@ | ||
import { CiSearch } from 'react-icons/ci'; | ||
|
||
import { | ||
IconContainerStyled, | ||
SearchBarStyled, | ||
SearchInputContainerStyled, | ||
SearchInputStyled, | ||
} from './SearchInputForm.style'; | ||
|
||
const SearchInputForm = () => { | ||
return ( | ||
<SearchInputContainerStyled> | ||
<SearchBarStyled> | ||
<SearchInputStyled /> | ||
<IconContainerStyled> | ||
<CiSearch size="1.5rem" /> | ||
</IconContainerStyled> | ||
</SearchBarStyled> | ||
</SearchInputContainerStyled> | ||
); | ||
}; | ||
|
||
export default SearchInputForm; |
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,22 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
interface BannerProps { | ||
bannerImageSrc?: string; | ||
width: number; | ||
height: number; | ||
} | ||
|
||
const BannerContainerStyled = styled.div<BannerProps>` | ||
width: ${({ width }) => `${width}rem`}; | ||
height: ${({ height }) => `${height}rem`}; | ||
border-radius: 10px; | ||
overflow: hidden; | ||
`; | ||
|
||
const BannerImageStyled = styled.img` | ||
object-fit: cover; | ||
width: 100%; | ||
height: 100%; | ||
`; | ||
|
||
export { BannerContainerStyled, BannerImageStyled }; |
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,24 @@ | ||
import { BannerContainerStyled, BannerImageStyled } from './Banner.style'; | ||
|
||
interface BannerProps { | ||
bannerImageSrc?: string; | ||
width: number; | ||
height: number; | ||
} | ||
|
||
const Banner = ({ bannerImageSrc, width, height }: BannerProps) => { | ||
return ( | ||
<BannerContainerStyled width={width} height={height}> | ||
{bannerImageSrc ? ( | ||
<BannerImageStyled src={bannerImageSrc} alt="배너 이미지" /> | ||
) : ( | ||
<BannerImageStyled | ||
src="https://picsum.photos/200/300" | ||
alt="이 부분은 배너 기본 이미지를 생성 전까진 임시입니다" | ||
/> | ||
)} | ||
</BannerContainerStyled> | ||
); | ||
}; | ||
|
||
export default Banner; |
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,32 @@ | ||
import Theme from '@/styles/Theme'; | ||
import styled from '@emotion/styled'; | ||
|
||
const HeaderLayoutStyled = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: flex-end; | ||
width: 100%; | ||
height: 15vh; | ||
min-height: 4rem; | ||
`; | ||
|
||
const HeaderContainerStyled = styled.div` | ||
display: flex; | ||
width: 80%; | ||
min-width: 60rem; | ||
border-bottom: 0.07rem solid ${Theme.color.lineColor}; | ||
`; | ||
|
||
const LogoWrapperStyled = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
|
||
const ChildrenContainerStyled = styled.div` | ||
display: flex; | ||
flex-grow: 1; | ||
align-items: center; | ||
`; | ||
|
||
export { HeaderLayoutStyled, HeaderContainerStyled, LogoWrapperStyled, ChildrenContainerStyled }; |
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 { ReactNode } from 'react'; | ||
|
||
import SpaceClubHomeLogo from '../SpaceClubHomeLogo/SpaceClubHomeLogo'; | ||
import { | ||
ChildrenContainerStyled, | ||
HeaderContainerStyled, | ||
HeaderLayoutStyled, | ||
LogoWrapperStyled, | ||
} from './Header.style'; | ||
|
||
interface HeaderProps { | ||
children?: ReactNode; | ||
} | ||
|
||
const Header = ({ children }: HeaderProps) => { | ||
return ( | ||
<HeaderLayoutStyled> | ||
<HeaderContainerStyled> | ||
<LogoWrapperStyled> | ||
<SpaceClubHomeLogo /> | ||
</LogoWrapperStyled> | ||
<ChildrenContainerStyled>{children}</ChildrenContainerStyled> | ||
</HeaderContainerStyled> | ||
</HeaderLayoutStyled> | ||
); | ||
}; | ||
|
||
export default Header; |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const Container = styled.div` | ||
width: 100vw; | ||
height: 100vh; | ||
display: flex; | ||
`; | ||
|
||
export const Content = styled.div` | ||
flex-grow: 1; | ||
margin: 0 8rem; | ||
`; |
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,17 @@ | ||
import { Outlet } from 'react-router-dom'; | ||
|
||
import { Container, Content } from './Layout.style'; | ||
import SideNav from './SideNav'; | ||
|
||
const Layout = () => { | ||
return ( | ||
<Container> | ||
<SideNav /> | ||
<Content> | ||
<Outlet /> | ||
</Content> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default Layout; |
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,37 @@ | ||
import Theme from '@/styles/Theme'; | ||
import { css } from '@emotion/css'; | ||
import styled from '@emotion/styled'; | ||
|
||
export const Container = styled.div` | ||
position: fixed; | ||
width: 7rem; | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 1rem; | ||
padding-bottom: 1rem; | ||
box-sizing: border-box; | ||
background: ${Theme.color.logo_2}; | ||
color: ${Theme.color.gray}; | ||
`; | ||
|
||
export const AvatarGroup = styled.div` | ||
overflow: auto; | ||
flex-grow: 1; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 1rem; | ||
width: 100%; | ||
&:first-child { | ||
padding-top: 1rem; | ||
} | ||
`; | ||
export const iconStyle = css` | ||
display: block; | ||
width: 2rem; | ||
height: 2rem; | ||
cursor: pointer; | ||
`; |
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,36 @@ | ||
import getMyClub from '@/apis/users/getMyClub'; | ||
import Avatar from '@/components/common/Avatar/Avatar'; | ||
|
||
import { FaBell, FaHome, FaPlusCircle } from 'react-icons/fa'; | ||
import { Link, useNavigate } from 'react-router-dom'; | ||
|
||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
import { AvatarGroup, Container, iconStyle } from './SideNav.style'; | ||
|
||
const SideNav = () => { | ||
const { data: clubs } = useQuery(['myclubs', 'userid'], () => getMyClub({ id: '1' }), { | ||
refetchInterval: false, | ||
}); //userid에 받는 방식 고려 후, 리팩토링 | ||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<Container> | ||
<AvatarGroup> | ||
{clubs?.map((club) => ( | ||
<Link to={`/club/home/${club.id}`}> | ||
<Avatar key={club.id} avatarShape="normal" profileImageSrc={club.src}></Avatar> | ||
</Link> | ||
))} | ||
</AvatarGroup> | ||
<FaPlusCircle className={iconStyle} onClick={() => navigate('/club/create')} /> | ||
<FaHome className={iconStyle} onClick={() => navigate('/')} /> | ||
<FaBell className={iconStyle} onClick={() => alert('알림페이지 준비 중')} /> | ||
<Link to={`/profile`}> | ||
<Avatar avatarShape="rectangle" /> | ||
</Link> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default SideNav; |
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,5 +1,14 @@ | ||
import SearchInputForm from '@/components/SearchInputForm/SearchInputForm'; | ||
import Header from '@/components/common/Header/Header'; | ||
|
||
const MainPage = () => { | ||
return <div>main</div>; | ||
return ( | ||
<div> | ||
<Header> | ||
<SearchInputForm /> | ||
</Header> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MainPage; |
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