-
Notifications
You must be signed in to change notification settings - Fork 0
Feature(#17, #19, #20, #21, #205): home 페이지 API 연동, modernizr 적용 #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature(#17, #19, #20, #21, #205): home 페이지 API 연동, modernizr 적용 #229
Conversation
- 강의 생성과 강의 조회에 관련된 API 코드를 작성했습니다.
- 강의 생성과 강의 조회에 관련된 API 코드를 작성했습니다.
- set method만 사용하는 useToast에서 recoil method를 교체하였습니다.
- 발표자 페이지 접근을 막기 위해 Modernizr를 적용하였습니다.
- ts type 오류를 해결하였습니다.
- 강의 생성과 강의 조회에 관련된 API 코드를 작성했습니다.
- set method만 사용하는 useToast에서 recoil method를 교체하였습니다.
- 발표자 페이지 접근을 막기 위해 Modernizr를 적용하였습니다.
- 강의 생성과 강의 조회에 관련된 API 코드를 작성했습니다.
…ub.com/LellowMellow/web13_Boarlog into feature/231207-add-lecture-api-at-home
- API 요청과 관련하여 처리를 완료하였습니다.
✅ Deploy Preview for boarlog ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
- 배포를 위해 불필요한 코드를 제거하였습니다.
declare global { | ||
interface ModernizrStatic { | ||
touchevents: boolean; | ||
} | ||
|
||
var Modernizr: ModernizrStatic; | ||
} | ||
|
||
export {}; |
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.
아 이렇게 타입을 처리하는 방법이 있군요.
혹시 문제가 되지 않는다면 var를 const나 let으로 바꿔주는건 어떨까요?
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.
헉 그렇네요! 바로 반영해보겠습니다 :)
- var를 let으로 변경하였습니다.
const handleCreateButtonClicked = () => { | ||
axios | ||
.post(`${import.meta.env.VITE_API_SERVER_URL}/lecture`, { | ||
title, | ||
description, | ||
email: "[email protected]" | ||
}) | ||
.then((result) => { | ||
navigate(`/instructor?roomid=${result.data.code}`); | ||
}) | ||
.catch((error) => { | ||
console.log(error); | ||
}); | ||
}; |
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.
아하 이렇게 API 요청을 하는 군요!
배웠습니다
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.
사실 이 코드는 예전에 제가 사용했던 방법이라 좋은 방식인지는 잘 모르겠어요 ㅠㅠ 나중에 개선할 때 좀 더 생각해봐요 :)
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.
동령님 오늘 하루 너무 고생 많으셨습니다. ㅠㅠ LGTM 👍👍
frontend/global.d.ts
Outdated
interface ModernizrStatic { | ||
touchevents: boolean; | ||
} | ||
var Modernizr: ModernizrStatic; |
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.
let으로 바꿔도 좋을 것 같습니다!
var Modernizr: ModernizrStatic; | |
let Modernizr: ModernizrStatic; |
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.
변경 완료!!~~
@@ -0,0 +1,123 @@ | |||
/*! modernizr 3.6.0 (Custom Build) | MIT * |
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.
modernizr는 어렵네요..
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.
고생 진짜 많으셨어요ㅜㅜ
작업 개요
작업 사항
고민한 점들(필수 X)
modernizr 처리
상단 페이지에서
touch events
를 선택하여modernizr-custom.js
를 빌드하여 이를src
폴더에 위치시킵니다. 전역으로Modernizr
를 사용하기 위하여index.html
에script
태그를 이용하여 이를 불러옵니다.TypeScript 환경에서 작업하고 있기 때문에 이에 대한 type을 선언하였습니다.
types
폴더 하위에 다양한 type들을 정의할 수 있도록 작업하려 하였으나 기존에 작업하였던"types": ["vite-plugin-svgr/client"],
과typesRoot
설정이 겹쳐svg
관련 코드가 정상적으로 동작하지 않을 것을 고려하여global
로 관리할 수 있도록 하였습니다.src
하위에global.d.ts
를 정의하여 아래와 같이type
을 정의하였습니다.이를 적용하기 위해
tsconfig.json
에 다음을 추가하였습니다.이를 바탕으로
Modernizr
는 아래와 같이 활용할 수 있습니다.API 연결
강의 생성과 강의 참여에 관련된 API 연동을 완료하였습니다.
env
파일에 추가적인 환경변수를 정의하였습니다.이를 활용하여 각각 API를 연동하였습니다.
스크린샷(필수 X)
2023-12-07.20-57-26.mp4