-
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 #190 from themoment-team/develop
Release v0.1.0
- Loading branch information
Showing
484 changed files
with
16,295 additions
and
2,526 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,10 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 80 | ||
trim_trailing_whitespace = true |
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,11 @@ | ||
**/.next | ||
**/node_modules | ||
**/style.ts | ||
*.d.ts | ||
|
||
# axios http method function | ||
packages/api/admin/src/libs/api/admin.ts | ||
packages/api/client/src/libs/api/client.ts | ||
|
||
# page style | ||
**/styles/page/*.ts |
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,2 @@ | ||
**/.next | ||
**/node_modules |
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 @@ | ||
{ | ||
"singleQuote": true, | ||
"jsxSingleQuote": true, | ||
"trailingComma": "es5", | ||
"printWidth": 80 | ||
} |
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,5 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
} | ||
} |
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,3 @@ | ||
CLIENT_API_URL = 'client-api-url' | ||
ADMIN_API_URL = 'admin-api-url' | ||
ADMIN_SIGNIN_URL = 'admin-signin-url' |
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
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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,94 @@ | ||
'use client'; | ||
|
||
import { redirect } from 'next/navigation'; | ||
|
||
import styled from '@emotion/styled'; | ||
|
||
import { | ||
Category, | ||
Header, | ||
Banner, | ||
PostList, | ||
PostListHeader, | ||
GalleryList, | ||
} from 'admin/components'; | ||
|
||
import { useGetPostList } from 'api/client'; | ||
|
||
import { PaginationController } from 'ui'; | ||
|
||
const categoryParamsArray = ['', 'newsletter', 'gallery'] as const; | ||
|
||
const categoryQueryString = { | ||
newsletter: 'FAMILY_NEWSLETTER', | ||
gallery: 'EVENT_GALLERY', | ||
} as const; | ||
|
||
const PAGE_SIZE = 6; | ||
|
||
type CategoryParamsType = keyof typeof categoryQueryString; | ||
|
||
interface ListPageProps { | ||
params: { category: CategoryParamsType }; | ||
searchParams: { pageNumber: string }; | ||
} | ||
|
||
export default function ListPage({ | ||
params: { category }, | ||
searchParams, | ||
}: ListPageProps) { | ||
/** 1 ~ totalPages */ | ||
const pageNumber = Number(searchParams.pageNumber ?? 1); | ||
|
||
const { data } = useGetPostList( | ||
categoryQueryString[category], | ||
pageNumber, | ||
PAGE_SIZE | ||
); | ||
|
||
if (!categoryParamsArray.includes(category)) { | ||
redirect('/'); | ||
} | ||
|
||
if (Number.isNaN(pageNumber) || pageNumber < 1) { | ||
redirect(`/${category}`); | ||
} | ||
|
||
return ( | ||
<> | ||
<Header /> | ||
<Banner /> | ||
<ContentWrapper> | ||
<Category category={category} /> | ||
<PostListHeader category={category} marginTop='3rem' /> | ||
{category === 'gallery' ? ( | ||
<GalleryList postList={data?.postList ?? []} /> | ||
) : ( | ||
<PostList postList={data?.postList ?? []} /> | ||
)} | ||
{(data?.totalPages ?? 0) > 1 && ( | ||
<PaginationController | ||
pageNumber={pageNumber} | ||
totalPages={data?.totalPages ?? 0} | ||
/> | ||
)} | ||
</ContentWrapper> | ||
</> | ||
); | ||
} | ||
|
||
const ContentWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
margin-top: 2.5rem; | ||
padding-bottom: 5rem; | ||
`; | ||
|
||
// it's not working in client component | ||
|
||
// export function generateStaticParams() { | ||
// return [{ category: "newsletter" }, { category: "gallery" }]; | ||
// } | ||
|
||
// export const dynamicParams = false; |
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,13 @@ | ||
import { NextResponse } from 'next/server'; | ||
|
||
export async function GET(request: Request) { | ||
const { searchParams } = new URL(request.url); | ||
const fileUrl = searchParams.get('fileUrl'); | ||
|
||
if (!fileUrl) return NextResponse.error(); | ||
|
||
const res = await fetch(fileUrl); | ||
const file = await res.blob(); | ||
|
||
return new NextResponse(file); | ||
} |
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 @@ | ||
'use client'; | ||
|
||
import styled from '@emotion/styled'; | ||
|
||
export default function AuthLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return <Background>{children}</Background>; | ||
} | ||
|
||
const Background = styled.div` | ||
width: 100%; | ||
height: 100vh; | ||
background-color: #0e0f10; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
@media (max-height: 26.5rem) { | ||
height: auto; | ||
align-items: baseline; | ||
} | ||
`; |
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 @@ | ||
'use client'; | ||
|
||
import { GoogleLoginButton } from 'admin/components'; | ||
import * as S from 'admin/styles/page/signin'; | ||
|
||
export default function SignInPage() { | ||
return ( | ||
<S.SignInPage> | ||
<S.ModelWrapper> | ||
<S.SignInModel modelUrl='/models/school.webm' /> | ||
<S.ModelCover /> | ||
</S.ModelWrapper> | ||
<S.SignInContent> | ||
<S.Description> | ||
GSM 홈페이지 <S.LimeHighlight>관리자용 페이지</S.LimeHighlight> | ||
입니다. | ||
<br /> | ||
이용하시려면{' '} | ||
<S.SkyBlueHighlight>학교 전용 구글 아이디</S.SkyBlueHighlight>로 | ||
로그인해주세요. | ||
</S.Description> | ||
<GoogleLoginButton>Google 로그인</GoogleLoginButton> | ||
</S.SignInContent> | ||
</S.SignInPage> | ||
); | ||
} |
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 @@ | ||
'use client'; | ||
|
||
import { WarningIcon } from 'admin/assets'; | ||
import { GoogleLoginButton } from 'admin/components'; | ||
import * as S from 'admin/styles/page/signin'; | ||
|
||
export default function SignInWarningPage() { | ||
return ( | ||
<S.SignInWarning> | ||
<WarningIcon /> | ||
<S.WarningContent> | ||
<S.Description>학교 이메일로만 로그인 가능합니다.</S.Description> | ||
<GoogleLoginButton>다시 로그인</GoogleLoginButton> | ||
</S.WarningContent> | ||
</S.SignInWarning> | ||
); | ||
} |
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,42 @@ | ||
'use client'; | ||
|
||
import { useState } from 'react'; | ||
|
||
import Link from 'next/link'; | ||
|
||
import styled from '@emotion/styled'; | ||
|
||
import { AuthTitle, AuthModel } from 'admin/components'; | ||
|
||
import { Button } from 'ui'; | ||
|
||
export default function IntroPage() { | ||
const [isLoading, setIsLoading] = useState<boolean>(false); | ||
|
||
return ( | ||
<> | ||
<AuthTitle textAlign='center' marginTop='6.5rem'> | ||
승인이 완료되었습니다. | ||
</AuthTitle> | ||
<AuthModel modelUrl='/models/approve.webm' loop={false} marginTop='0' /> | ||
<Button | ||
position='absolute' | ||
bottom='1.5rem' | ||
onClick={() => { | ||
setIsLoading(true); | ||
}} | ||
isLoading={isLoading} | ||
> | ||
<CustomLink href='/'>확인</CustomLink> | ||
</Button> | ||
</> | ||
); | ||
} | ||
|
||
const CustomLink = styled(Link)` | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
`; |
Oops, something went wrong.
5745962
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:
official-gsm-admin – ./
official-gsm-admin-the-moment.vercel.app
official-gsm-admin-git-main-the-moment.vercel.app
official-gsm-front-admin.vercel.app
admin.official.hellogsm.kr