stfexsavle / with-savle Goto Github PK
View Code? Open in Web Editor NEWHome Page: with-savle.vercel.app
Home Page: with-savle.vercel.app
// before
import style from "styles/GoalId.module.scss";
// after
import style from "@/styles/GoalId.module.scss";
피드백 받은 것처럼 아래처럼 변경하고, 최상단에 위치한 styles 폴더를 src 내부에 넣으려고 합니다.
각자 폴더 이동하시고 담당 페이지의 import 주소 변경하려고 하는데, 다른 의견 있으신 분 계실까요
저축계산기 페이지에서 절차에 따라 바뀌는 step component 추가
저축계산기 result 오류
comment input과 list 항목 추가
목적에 맞게 컴포넌트를 분리하고
커스텀 hook도 기능에 따라 수정
##작업 상세 내용
미림님이 작성하신 comment.js 내부에 setCount를 작성했었습니다.
오류가 있어서 Comment 내부에 useEffect를 사용해야 오류가 사라지는데, 코드가 지저분해질까 걱정되네요
useEffect(() => {
if (!hidden) {
setCount(data.length);
}
});
해당 코드가 comment.js 내부에 들어가야 합니다.
어떻게 넣는게 가장 이상적일까요?
const arrlikes = [];
const newLikes = [];
if (likes !== null) {
arrlikes = likes.split(",");
}
if (like) {
newLikes = arrlikes.filter((value) => value.toString() !== id.toString());
setLikeNums((like) => (like = like - 1));
} else {
newLikes = [...arrlikes, id];
setLikeNums((like) => (like = like + 1));
}
let -> const으로 변환하면서 arrlikes, newLikes 재할당 부분에서 오류가 나는데, 어떻게 수정하셨을까요?
고민해결소 부분에서도 해당 Hook을 사용해야 하기에 여쭤봅니다!
사용자가 투표를 하면 count 증가가 되는 api가 누락됐습니다.
주소는 /api/vote/${id}
이고 PUT 호출로 제작하고 있습니다.
만드는대로 말씀 드리겠습니다
#166 Revalidate 수정했습니다.
기존 index.js
return {
props: {
fallback: {
"/api/vote": response.data.results,
},
revalidation: ONE_DAY_TO_SECONDS,
},
};
변경 index.js
return {
props: {
fallback: {
"/api/vote": response.data.results,
},
},
revalidate: ONE_DAY_TO_SECONDS,
};
revalidate 작동 안하는 버그가 있어 수정했습니다.
제가 이미 반영 했고, goal, vote 두 곳의 index.js입니다.
변경된 것 확인만 해주세요~
저축계산기 페이지에서 input-box 반응형 적용
input 으로 인한 리랜더링 수정
Comment 수정된 api로 get 수정
Comment 등록 후 데이터 표시
style jsx에서 styles.module로 css 수정
component안에 상태관리 custom hook으로 관리
eslint에 맞게 코드 수정
배포 환경에서 SSG + CSR 테스팅 결과
페이지 소스보기에서 새로운 글 목록이 나타나지 않음 -> SEO에 좋지 못함
제가 생각한 해결 방안
어떤 방법으로 할지 의견주시면 감사하겠습니다!
저축계산기 페이지 tablet(577px-1199px)일 때 뷰포트에 맞는 UI 적용
margin-top과 navbar 겹치는 issue 해결
export const fetchGetCommentById = async (id) => await axios.get(`${server}/api/goal/comment/${id}`);
제가 useSwr을 사용한는데
const { data, mutate } = useSWR( `${server}/api/${value}/comment/${id}`,fetcher,);
위 주소를 사용합니다
const fetcher = async (url) => {
const response = await axios.get(url);
return response.data.results;
};
useSWR에서 fetcher에서 axios를 사용합니다
주신 fetch함수로 useSWR을 어떻게 사용해야할지 모르겠습니다
useSWR을 첫번째 인자로 url을 받고 fetcher에서 데이터를 받는 로직인거 같습니다.
혹시 주소 수정 부탁 드려도 될까요 ? 아님 혹시 주신 함수로 받는 방법 아실까요 ??
좋아요 기능을 훅으로 따로 빼는 건 어떨까요?
styles 폴더 이동
utils 파일 index에서 export
SEO추가
custom hook code refactoring
투표하고 나서 댓글 보이는 기능 구현 하실건가요 ?
지금은 투표하고나서 토글을 눌러야 댓글을 볼수있는데
처음 기획은 일단 투표하고 댓글이 보이는 기획이었습니다
어떻게 할까요 ???
앱 설치 바로가기 컴포넌트 구현
저축계산기 페이지에서 목적과 금액을 입력받아 결과값 보여준다
.favorite_comment_share {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20px;
padding-bottom: 8px;
border-bottom: 1px solid $grey-3;
position: relative;
.favorite_comment {
display: flex;
align-items: center;
justify-content: space-between;
span {
margin-left: 4px;
font-size: 13px;
font-weight: 700;
}
.favorite {
margin-right: 8px;
}
}
}
Id.module.scss 108Line입니다.
FavoriteCommentShare 컴포넌트를 목표 상세 보기에서 사용하려니까 스타일이 적용이 되질 않네요.
아마 container 안에 적으셔서 그런 거 같은데..
해당 스타일을 Id.module.scss 파일 최상단으로 옮기거나, 공통 컴포넌트의 scss은 별도로 관리하는 방법이 있겠네요.
어떤 방법이 편하실까요?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.