-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev/fe' of https://github.com/woowacourse-teams/2024-co…
…de-zap into refactor/969-set-monorepo
- Loading branch information
Showing
65 changed files
with
247 additions
and
131 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,75 @@ | ||
name: Frontend CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev/fe | ||
paths: | ||
- "frontend/**" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
frontend-directory: ./frontend | ||
steps: | ||
- name: 체크아웃 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Node.js 설치 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
|
||
- name: 환경 파일 생성 | ||
run: | | ||
if [ "${{ github.ref_name }}" == "main" ]; then | ||
echo "REACT_APP_API_URL=${{ secrets.REACT_APP_API_URL }}" > ${{ env.frontend-directory }}/.env.production | ||
echo "APP_ENV=${{ secrets.APP_ENV_PROD }}" >> ${{ env.frontend-directory }}/.env.production | ||
else | ||
echo "REACT_APP_API_URL=${{ secrets.REACT_APP_BETA_API_URL }}" > ${{ env.frontend-directory }}/.env.production | ||
echo "APP_ENV=${{ secrets.APP_ENV_DEV }}" >> ${{ env.frontend-directory }}/.env.production | ||
fi | ||
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> ${{ env.frontend-directory }}/.env.production | ||
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> ${{ env.frontend-directory }}/.env.sentry-build-plugin | ||
echo "AMPLITUDE_API_KEY=${{ secrets.AMPLITUDE_API_KEY }}" >> ${{ env.frontend-directory }}/.env.production | ||
- name: 환경 파일 권한 설정 | ||
run: chmod 644 ${{ env.frontend-directory }}/.env.* | ||
|
||
- name: npm install | ||
run: npm install | ||
working-directory: ${{ env.frontend-directory }} | ||
|
||
- name: npm run build | ||
run: npm run build | ||
working-directory: ${{ env.frontend-directory }} | ||
|
||
- name: AWS credentials 설정 | ||
uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ap-northeast-2 | ||
|
||
- name: S3 업로드 | ||
run: | | ||
if [ "${{ github.ref_name }}" == "main" ]; then | ||
aws s3 sync ./dist s3://${{ secrets.S3_BUCKET_NAME }}/prod/ --delete | ||
else | ||
aws s3 sync ./dist s3://${{ secrets.S3_BUCKET_NAME }}/dev/ --delete | ||
fi | ||
working-directory: ${{ env.frontend-directory }} | ||
|
||
- name: CloudFront 캐시 무효화 | ||
run: | | ||
if [ "${{ github.ref_name }}" == "main" ]; then | ||
aws cloudfront create-invalidation \ | ||
--distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID_PROD }} \ | ||
--paths "/*" | ||
else | ||
aws cloudfront create-invalidation \ | ||
--distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID_DEV }} \ | ||
--paths "/*" | ||
fi |
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,17 +1,10 @@ | ||
import { useState } from 'react'; | ||
|
||
import { | ||
Button, | ||
Input, | ||
LoadingBall, | ||
Modal, | ||
Text, | ||
Textarea, | ||
} from '@/components'; | ||
import { Button, Input, LoadingBall, Modal, Text, Textarea } from '@/components'; | ||
import { useInput, useInputWithValidate, useToggle, useToast } from '@/hooks'; | ||
import { useAuth } from '@/hooks/authentication'; | ||
import { validateEmail } from '@/service/validates'; | ||
import { theme } from '@design/style/theme'; | ||
import { theme } from '@/style/theme'; | ||
|
||
import * as S from './ContactUs.style'; | ||
|
||
|
@@ -34,9 +27,7 @@ const ContactUs = () => { | |
|
||
const isValidContents = message.trim().length !== 0; | ||
|
||
const handleSubmit = ( | ||
e: React.FormEvent<HTMLFormElement> | React.MouseEvent<HTMLButtonElement> | ||
) => { | ||
const handleSubmit = (e: React.FormEvent<HTMLFormElement> | React.MouseEvent<HTMLButtonElement>) => { | ||
e.preventDefault(); | ||
|
||
if (!isValidContents || emailErrorMessage) { | ||
|
@@ -94,15 +85,11 @@ const ContactUs = () => { | |
<Modal.Body> | ||
<S.Form onSubmit={handleSubmit}> | ||
<Text.Medium as='p' color={theme.color.light.secondary_500}> | ||
질문/피드백을 편하게 남겨주세요! 여러분의 의견은 더 나은 서비스를 | ||
만드는 데 큰 도움이 됩니다. <br /> | ||
이미지 등을 함께 보내실 경우 [email protected]으로 직접 | ||
이메일을 보내실 수 있습니다. | ||
질문/피드백을 편하게 남겨주세요! 여러분의 의견은 더 나은 서비스를 만드는 데 큰 도움이 됩니다. <br /> | ||
이미지 등을 함께 보내실 경우 [email protected]으로 직접 이메일을 보내실 수 있습니다. | ||
</Text.Medium> | ||
<Textarea id='voc' variant='outlined'> | ||
<Textarea.Label htmlFor={'voc'}> | ||
무엇을 도와드릴까요? | ||
</Textarea.Label> | ||
<Textarea.Label htmlFor={'voc'}>무엇을 도와드릴까요?</Textarea.Label> | ||
<Textarea.TextField | ||
minRows={5} | ||
maxRows={10} | ||
|
@@ -112,16 +99,11 @@ const ContactUs = () => { | |
/> | ||
</Textarea> | ||
<Text.Medium as='p' color={theme.color.light.secondary_500}> | ||
답변이 필요하시면 아래 이메일 주소를 남겨주세요. 이메일은 오직 | ||
답변을 위해서만 사용됩니다 :) | ||
답변이 필요하시면 아래 이메일 주소를 남겨주세요. 이메일은 오직 답변을 위해서만 사용됩니다 :) | ||
</Text.Medium> | ||
<Input variant='outlined' isValid={!emailErrorMessage}> | ||
<Input.Label>이메일 (선택)</Input.Label> | ||
<Input.TextField | ||
value={email} | ||
onChange={handleEmail} | ||
disabled={isSending} | ||
/> | ||
<Input.TextField value={email} onChange={handleEmail} disabled={isSending} /> | ||
<Input.HelperText>{emailErrorMessage}</Input.HelperText> | ||
</Input> | ||
</S.Form> | ||
|
@@ -135,10 +117,7 @@ const ContactUs = () => { | |
<LoadingBall /> | ||
</S.LoadingContainer> | ||
) : ( | ||
<Button | ||
disabled={isValidContents && !emailErrorMessage ? false : true} | ||
onClick={handleSubmit} | ||
> | ||
<Button disabled={isValidContents && !emailErrorMessage ? false : true} onClick={handleSubmit}> | ||
보내기 | ||
</Button> | ||
)} | ||
|
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 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 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 { END_POINTS } from '@/routes'; | ||
|
||
import { apiClient } from './config'; | ||
|
||
export interface ContactBody { | ||
message: string; | ||
email: string | null; | ||
name: string | null; | ||
memberId: number | null; | ||
} | ||
|
||
export const postContact = async (contactBody: ContactBody) => | ||
await apiClient.post(`${END_POINTS.CONTACT}`, contactBody); |
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 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 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,7 @@ | ||
import { http } from 'msw'; | ||
|
||
import { API_URL } from '@/api'; | ||
import { END_POINTS } from '@/routes'; | ||
import { mockResponse } from '@/utils/mockResponse'; | ||
|
||
export const contactHandlers = [http.get(`${API_URL}${END_POINTS.CONTACT}`, () => mockResponse({ status: 201 }))]; |
Oops, something went wrong.