code
stringlengths
41
34.3k
lang
stringclasses
8 values
review
stringlengths
1
4.74k
@@ -0,0 +1,122 @@ +package nextstep.security.access; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import nextstep.security.core.GrantedAuth...
Java
```suggestion } if (roleName.equals(lowerRole.getAuthority())) { throw new RuntimeException(); } ``` else if가 가독성이 높다는 의견이 있을 수 있지만 개인적으로는 if 후의 else, else if는 컨텍스트를 계속 들고 코드를 읽게 만드는 원인이라 그냥 if 처리하는 것이 더 낫다는 생각입니다.
@@ -0,0 +1,13 @@ +package nextstep.security.access; + +import java.util.Collection; +import nextstep.security.core.GrantedAuthority; + +public final class NullRoleHierarchy implements RoleHierarchy { + + @Override + public Collection<GrantedAuthority> getReachableGrantedAuthorities( + Collection<Grante...
Java
기존 스프링시큐리티 코드에서 가져온 부분인데, 생각해보니 저희 구조에선 불필요하네요,, 수정해두겠습니다
@@ -0,0 +1,93 @@ +package nextstep.security.access; + +import nextstep.security.core.GrantedAuthority; +import nextstep.security.core.SimpleGrantedAuthority; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import java.util.Collection; +import java.util.Set; + +import static org.assertj...
Java
순환참조 예외 테스트까지 잘 추가해주셨네요 👍
@@ -0,0 +1,93 @@ +package nextstep.security.access; + +import nextstep.security.core.GrantedAuthority; +import nextstep.security.core.SimpleGrantedAuthority; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import java.util.Collection; +import java.util.Set; + +import static org.assertj...
Java
테스트가 27에서 실패해도 28라인에 대한 assertion까지 피드백받을 수 있게 `assertAll`를 활용해 볼 수도 있겠네요 :)
@@ -1,5 +1,98 @@ import React from 'react'; +import { useState, useEffect } from 'react'; +import { useNavigate } from 'react-router-dom'; +import './Login.scss'; -export default function Login() { - return <div>Hello, Hyeonze!</div>; -} +const Login = () => { + const [idInput, setIdInput] = useState(''); + const...
Unknown
이 두 조건을 &&로 걸면 state를 하나만 사용하고 validation을 확인할 수 있지 않을까요? 왜 유즈이펙트를 쓰셨는지 궁금합니다.
@@ -1,5 +1,98 @@ import React from 'react'; +import { useState, useEffect } from 'react'; +import { useNavigate } from 'react-router-dom'; +import './Login.scss'; -export default function Login() { - return <div>Hello, Hyeonze!</div>; -} +const Login = () => { + const [idInput, setIdInput] = useState(''); + const...
Unknown
id와 pw로 한번에 validation하고 activateBtn에 True/false를 지정하면 될 것 같습니다. isValidatedId나 isValidatedPw는 크게 필요하지 않을 것 같아요. 불필요한 리랜더링도 줄일 수 있다고 생각하는데 어떻게 생각하시나요?
@@ -0,0 +1,66 @@ +@use '../../../styles/mixin.scss' as mixin; +@use '../../../styles/color.scss' as clr; + +body { + background: clr.$bg-login; + + .login { + position: relative; + top: -80px; + + #wrapper { + @include mixin.flex($align: center); + position: relative; + flex-direction: column;...
Unknown
input이 inline-block이고 수직으로 정렬하려고 display: flex를 쓰신 것 같습니다. 굉장히 좋은데요 저는 Input을 display: block해주는 것도 괜찮은 방법이지 않을까 생각합니다.
@@ -0,0 +1,66 @@ +@use '../../../styles/mixin.scss' as mixin; +@use '../../../styles/color.scss' as clr; + +body { + background: clr.$bg-login; + + .login { + position: relative; + top: -80px; + + #wrapper { + @include mixin.flex($align: center); + position: relative; + flex-direction: column;...
Unknown
'로그인' 이라는 글자 센터에 맞추기 위해 display: flex주신 것 같아요. 좋은방법이지만 flex와 그 속성들이 좀 떨어져 있는 것 같습니다. 이렇게 연관되는 css속성은 붙여 주시는 게 나중에 유지보수 측면에서도 좋을 것 같아 추천 드립니다!
@@ -0,0 +1,26 @@ +import React, { useState } from 'react'; +import { AiFillDelete, AiOutlineHeart, AiFillHeart } from 'react-icons/ai'; + +const Comment = ({ id, userId, value, time, handleDelete }) => { + const [isLiked, setIsLiked] = useState(false); + + const toggleLike = () => { + setIsLiked(!isLiked); + }; +...
Unknown
저번 세션에서 멘토님이 하신 것처럼 변수명을 조금 더 구체적으로 어떤 내용을 담고 있는지를 작성해 주시면 좋을 것 같습니다. commentVal이 댓글 전체를 관리하는 배열이고 el이 각 배열의 요소이니깐 commentVal대신 allComments, el대신 comment등으로 (이건 저도 조금 애매하네요 .. 죄송합니다) (배열은 s를 붙인 변수명으로 하는 게 좋을 것 같습니다!)
@@ -0,0 +1,43 @@ +span.comment { + padding-left: 10px; + + small { + color: #a3a3a3; + } + + &:first-child { + padding: 10px; + font-weight: bold; + } + + svg { + &.delete { + display: none; + cursor: pointer; + } + + &.hearts { + color: #a3a3a3; + position: absolute; + ...
Unknown
span에 대해서만 스타일링을 해주셨는데 이러면 다른 컴포넌트의 span에도 영향이 가지 않을까 조심스럽게 생각해 봅니다. 개인적으로 className을 주는 게 조금 더 안전할 것 같습니다 추가적으로 svg태그도 span 내부에 nesting해주시면 좋을 것 같아요. ``` svg { &.red {} &.blue {} } ```
@@ -0,0 +1,87 @@ +import React, { useState } from 'react'; +import { AiFillHeart, AiOutlineComment, AiOutlineUpload } from 'react-icons/ai'; +import { BiDotsHorizontalRounded } from 'react-icons/bi'; +import { GrBookmark } from 'react-icons/gr'; +import './Feeds.scss'; +import Comments from './Comment/Comments'; + +exp...
Unknown
굉장히 잘 짜신 것 같습니다!! 👏 그런데 순서가 조금 애매한 것 같아요. 17)에서 uploadComment 호출을 하고 31)에서 currInputVal( " " ) -> 18 ) 에서 currInputVal( e.target.value ) 순으로 진행이 된다면 댓글을 추가하더라도 input은 비워지지 않을 것 같습니다.
@@ -0,0 +1,101 @@ +@use '../../../../styles/mixin.scss' as mixin; +@use '../../../../styles/color.scss' as clr; + +.feeds { + position: relative; + top: 77px; + width: 60%; + margin-bottom: 80px; + background: #fff; + + .top_menu { + @include mixin.flex($justify: space-between, $align: center); + height: 82...
Unknown
Feeds.jsx에서 .feeds의 바로 자식요소가 article이라 article을 .feeds 바로 다음에 써주는 게 좋을 것 같습니다. 그리고 height요소는 자식요소들의 높이에 따라 결정되니깐 height: 100%를 주어도 feeds의 높이가 변하지는 않을 것 같다는 생각이 드는데 혹시 설정하신 이유가 있으신가요?
@@ -1,5 +1,98 @@ import React from 'react'; +import { useState, useEffect } from 'react'; +import { useNavigate } from 'react-router-dom'; +import './Login.scss'; -export default function Login() { - return <div>Hello, Hyeonze!</div>; -} +const Login = () => { + const [idInput, setIdInput] = useState(''); + const...
Unknown
이 두 조건을 &&로 걸면 state를 하나만 사용하고 validation을 확인할 수 있지 않을까요? => 맞는 것 같습니다. 수정 전 코드에서 유효성검사를 changeIdInput, changePwInput 내에서 각각 해줬었는데 호환성 검사에 딜레이가 생겨서 useEffect를 사용하는게 해결책이라 생각했습니다. 이 과정에서 changeIdInput, changePwInput 내부의 삼항연산자들을 useEffect 내부로 잘라내어 오게 되면서 로직이 길어진 것 같습니다.
@@ -1,5 +1,98 @@ import React from 'react'; +import { useState, useEffect } from 'react'; +import { useNavigate } from 'react-router-dom'; +import './Login.scss'; -export default function Login() { - return <div>Hello, Hyeonze!</div>; -} +const Login = () => { + const [idInput, setIdInput] = useState(''); + const...
Unknown
[공식문서 React로 사고하기](https://ko.reactjs.org/docs/thinking-in-react.html#step-3-identify-the-minimal-but-complete-representation-of-ui-state) 를 보시면 어떤 값들이 state가 되어야하는지에 대해 적혀있습니다. 각각 살펴보고 해당 데이터는 state로 적절한지 댓글로 남겨주세요. 각 데이터에 대해 아래의 세 가지 질문을 통해 결정할 수 있습니다 > 1. 부모로부터 props를 통해 전달됩니까? 그러면 확실히 state가 아닙니다. > > 2. 시간...
@@ -1,5 +1,98 @@ import React from 'react'; +import { useState, useEffect } from 'react'; +import { useNavigate } from 'react-router-dom'; +import './Login.scss'; -export default function Login() { - return <div>Hello, Hyeonze!</div>; -} +const Login = () => { + const [idInput, setIdInput] = useState(''); + const...
Unknown
라이브리뷰 때 말씀드린 것처럼 조건의 falsy, truthy한 값을 이용해 리팩토링 해주세요! :) 또는 state를 줄일 경우 불필요할 수도 있겠네요
@@ -0,0 +1,66 @@ +@use '../../../styles/mixin.scss' as mixin; +@use '../../../styles/color.scss' as clr; + +body { + background: clr.$bg-login; + + .login { + position: relative; + top: -80px; + + #wrapper { + @include mixin.flex($align: center); + position: relative; + flex-direction: column;...
Unknown
위 코드는 어디에 작성되면 좋을까요?
@@ -0,0 +1,43 @@ +span.comment { + padding-left: 10px; + + small { + color: #a3a3a3; + } + + &:first-child { + padding: 10px; + font-weight: bold; + } + + svg { + &.delete { + display: none; + cursor: pointer; + } + + &.hearts { + color: #a3a3a3; + position: absolute; + ...
Unknown
자주 사용이 되는 컬러값이네요! 이런 경우 sass variables 기능을 이용하는것은 어떨까요?
@@ -0,0 +1,87 @@ +import React, { useState } from 'react'; +import { AiFillHeart, AiOutlineComment, AiOutlineUpload } from 'react-icons/ai'; +import { BiDotsHorizontalRounded } from 'react-icons/bi'; +import { GrBookmark } from 'react-icons/gr'; +import './Feeds.scss'; +import Comments from './Comment/Comments'; + +exp...
Unknown
.해당 부분도 좀 더 반복되는 단어를 줄일 수 없을지 고민해봅시다. 더불어 불필요한 state값도 보이네요! 위 리뷰를 참고해 수정해주세요!
@@ -0,0 +1,101 @@ +@use '../../../../styles/mixin.scss' as mixin; +@use '../../../../styles/color.scss' as clr; + +.feeds { + position: relative; + top: 77px; + width: 60%; + margin-bottom: 80px; + background: #fff; + + .top_menu { + @include mixin.flex($justify: space-between, $align: center); + height: 82...
Unknown
class명은 어떤 형태가 좋을까요?! 해당 class명은 '동작'을 나타내기에 클래스 네임보다는 함수명처럼 느껴집니다!
@@ -1,5 +1,98 @@ import React from 'react'; +import { useState, useEffect } from 'react'; +import { useNavigate } from 'react-router-dom'; +import './Login.scss'; -export default function Login() { - return <div>Hello, Hyeonze!</div>; -} +const Login = () => { + const [idInput, setIdInput] = useState(''); + const...
Unknown
- 불필요한 주석처리는 삭제해주세요! - 더불어서 className 자체를 '색'으로 지정하는 것은 좋은 네이밍은 아닌 것 같습니다. 어떤 네이밍이 적합할지 고민하셔서 , 해당 요소가 무엇인지를 잘 나타내는 네이밍으로 수정해주세요. - 플러스! 여기에도 사용하지 않아도 되는 삼항연사자가 숨어있네요! 확인해주세요
@@ -0,0 +1,101 @@ +@use '../../../../styles/mixin.scss' as mixin; +@use '../../../../styles/color.scss' as clr; + +.feeds { + position: relative; + top: 77px; + width: 60%; + margin-bottom: 80px; + background: #fff; + + .top_menu { + @include mixin.flex($justify: space-between, $align: center); + height: 82...
Unknown
이렇게 각 요소에 background color를 각각 다 넣어주신 이유가 있으실까요?
@@ -0,0 +1,92 @@ +{ + "stories": [ + { "imgUrl": "images/joonyoung/stories/story1.jpg", "username": "Enna" }, + { "imgUrl": "images/joonyoung/stories/story2.jpg", "username": "Jesy" }, + { "imgUrl": "images/joonyoung/stories/story3.jpg", "username": "Denial" }, + { "imgUrl": "images/joonyoung/stories/story...
Unknown
mockData king 준영님👍 정말 감사합니다. 세부 내용은 임의로 변경한 후, 데이터의 형식좀 빌려다 쓰겠습니다 감사합니다!
@@ -1,69 +1,105 @@ import Image from "next/image"; import Label from "@/components/Common/Label"; import icon_like_red from "@public/assets/icon_like_red.png"; -import img_avatar1 from "@public/assets/img_avatar1.svg"; import icon_active_star from "@public/assets/icon_active_star.svg"; import link from "@public/as...
Unknown
삭제해주세요!
@@ -1,16 +1,36 @@ -import MyPlanNav from "./MyPlanNav"; -import Layout from "../Common/Layout"; -import PlanCard from "./Cards/PlanCard"; -import QuotationCardList from "./QuotationCardList"; -import { Plan } from "@/services/planService"; +import { useRouter } from "next/router"; +import MyPlanNav from "@/components/M...
Unknown
뒤로가기 인가요??
@@ -1,16 +1,36 @@ -import MyPlanNav from "./MyPlanNav"; -import Layout from "../Common/Layout"; -import PlanCard from "./Cards/PlanCard"; -import QuotationCardList from "./QuotationCardList"; -import { Plan } from "@/services/planService"; +import { useRouter } from "next/router"; +import MyPlanNav from "@/components/M...
Unknown
절대 경로로 써주시면 나중에 파일 위치가 변해도 문제가 없습니다!
@@ -19,7 +19,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "check": "npm run lint && tsc --noEmit && npm run build" }, "eslintConfig": { "extends": [
Unknown
next로도 lint를 사용할 수 있군요?
@@ -0,0 +1,22 @@ +import * as yup from 'yup'; +import {ShippingFormData} from '@/features/cart/cartProcess/shoppingCheckOut/ShoppingCheckOut'; + +const phoneRegex = /^[0-9]{10,11}$/; +const zipcodeRegex = /^[0-9]{5}$/; +export const shippingSchema = yup.object().shape({ + name: yup + .string() + .required('이름을 입...
TypeScript
굿. 이거 해내셨네요
@@ -0,0 +1,22 @@ +import * as yup from 'yup'; +import {ShippingFormData} from '@/features/cart/cartProcess/shoppingCheckOut/ShoppingCheckOut'; + +const phoneRegex = /^[0-9]{10,11}$/; +const zipcodeRegex = /^[0-9]{5}$/; +export const shippingSchema = yup.object().shape({ + name: yup + .string() + .required('이름을 입...
TypeScript
정규식을 상수화하면 좀 더 보기 편할 것 같아요 ex) `const MOBILE_REGEX = /^[0-9]{10,11}$/;`
@@ -1,11 +1,8 @@ import styled from 'styled-components'; import Image from 'next/image'; import confirmIcon from 'public/images/shop/confirm.svg'; -import {getRequest, getStoredToken} from '@/utils/apiClient'; -import {API_ENDPOINTS} from '@/config/ApiEndPoints'; -import {OrderResponse} from '@/types/order'; -import...
Unknown
크으 커스텀훅으로 분리하셨군요
@@ -1,11 +1,8 @@ import styled from 'styled-components'; import Image from 'next/image'; import confirmIcon from 'public/images/shop/confirm.svg'; -import {getRequest, getStoredToken} from '@/utils/apiClient'; -import {API_ENDPOINTS} from '@/config/ApiEndPoints'; -import {OrderResponse} from '@/types/order'; -import...
Unknown
이렇게 map 을 도는 대상이 길어질 경우 컴포넌트로 분리하면 가독성이 아주 좋아집니다(+렌더링 격리)
@@ -1,11 +1,15 @@ -import {useForm} from 'react-hook-form'; +import {Resolver, useForm, FormProvider} from 'react-hook-form'; import styled from 'styled-components'; import {CartResponse} from '@/types/cart'; import {postRequest} from '@/utils/apiClient'; import {API_ENDPOINTS} from '@/config/ApiEndPoints'; +import...
Unknown
as로 타입단언 하는 방법밖에 없나요?
@@ -1,11 +1,15 @@ -import {useForm} from 'react-hook-form'; +import {Resolver, useForm, FormProvider} from 'react-hook-form'; import styled from 'styled-components'; import {CartResponse} from '@/types/cart'; import {postRequest} from '@/utils/apiClient'; import {API_ENDPOINTS} from '@/config/ApiEndPoints'; +import...
Unknown
object로 해주셨군요!
@@ -1,7 +1,9 @@ import { + Control, FieldErrors, UseFormHandleSubmit, - UseFormRegister, + useController, + useFormContext, } from 'react-hook-form'; import styled from 'styled-components'; import {ShippingFormData} from './ShoppingCheckOut'; @@ -65,41 +67,64 @@ const ErrorMessage = styled.span` margin...
Unknown
괜찮긴 한데, 이런식으로 하면 하나의 컴포넌트(현재 컴포넌트)에서 use훅을 너무 많이 호출해서 리렌더링을 피할수가 없을 것 같아요. 예시) nameField값만 업데이트되고, 나머지(phoneField 등) 값은 그대로여도 ShoppingCheckOutInfo 컴포넌트 전체가 리렌더링되면서 하위 컴포넌트들 모두 리렌더링이 일어남 그래서 필드별로 컴포넌트를 분리하라고 말씀드렸던 거에요. 가독성도 좋아질 수 있고 관심사 분리의 장점도 있습니다. 이건 다음 PR로 작업해 보시죠
@@ -1,7 +1,9 @@ import { + Control, FieldErrors, UseFormHandleSubmit, - UseFormRegister, + useController, + useFormContext, } from 'react-hook-form'; import styled from 'styled-components'; import {ShippingFormData} from './ShoppingCheckOut'; @@ -65,41 +67,64 @@ const ErrorMessage = styled.span` margin...
Unknown
많이 줄었군오
@@ -1,4 +1,4 @@ -import axios, {AxiosResponse} from 'axios'; +import axios, {AxiosResponse, InternalAxiosRequestConfig} from 'axios'; import {API_BASE_URL} from '@/config/ApiEndPoints'; import Cookies from 'js-cookie'; @@ -9,15 +9,48 @@ const apiClient = axios.create({ }, }); +apiClient.interceptors.request.u...
TypeScript
앞으로 모든 인증은 이쪽에서 처리하게 되겠군요 ㅎㅎ
@@ -1,4 +1,4 @@ -import axios, {AxiosResponse} from 'axios'; +import axios, {AxiosResponse, InternalAxiosRequestConfig} from 'axios'; import {API_BASE_URL} from '@/config/ApiEndPoints'; import Cookies from 'js-cookie'; @@ -9,15 +9,48 @@ const apiClient = axios.create({ }, }); +apiClient.interceptors.request.u...
TypeScript
모든 인증을 한군데서 처리하면서 서버에서 온 요청(SSR 등)과 클라이언트에서 온 요청마다 쿠키 파싱을 다르게 할 수 있습니다(못한다거나) 그래서 `typeof window`로 서버/클라이언트 환경을 체크하고 다르게 처리해야 합니다 그리고 클라이언트(브라우저) 환경인 경우 `withCredentials: true`(https://inpa.tistory.com/entry/AXIOS-%F0%9F%93%9A-CORS-%EC%BF%A0%ED%82%A4-%EC%A0%84%EC%86%A1withCredentials-%EC%98%B5%EC%85%98) 설정으로 자동으...
@@ -1,7 +1,9 @@ import { + Control, FieldErrors, UseFormHandleSubmit, - UseFormRegister, + useController, + useFormContext, } from 'react-hook-form'; import styled from 'styled-components'; import {ShippingFormData} from './ShoppingCheckOut'; @@ -65,41 +67,64 @@ const ErrorMessage = styled.span` margin...
Unknown
네네, 여기 이해가 안되는 부분이있어서 다음 pr 작업하여 코멘트 남기겠습니다.
@@ -1,4 +1,4 @@ -import axios, {AxiosResponse} from 'axios'; +import axios, {AxiosResponse, InternalAxiosRequestConfig} from 'axios'; import {API_BASE_URL} from '@/config/ApiEndPoints'; import Cookies from 'js-cookie'; @@ -9,15 +9,48 @@ const apiClient = axios.create({ }, }); +apiClient.interceptors.request.u...
TypeScript
넵, https://github.com/wjdals0304/ecommerce-project/pull/47 해당 pr 에서 코멘트할게요.
@@ -19,7 +19,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "check": "npm run lint && tsc --noEmit && npm run build" }, "eslintConfig": { "extends": [
Unknown
궁금한게, 공통적으로 사용하는 apiClient.get 파라미터를 변경하였는데 사용하고 있는곳에서 컴파일 버그가 안 잡히는 현상이 있었어요. 해당 파일 접근할때만 빨간색이 생기더라구요. @uu29 자바스크립트에서는 컴파일할때 버그 잡는게 없나요?
@@ -19,7 +19,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "check": "npm run lint && tsc --noEmit && npm run build" }, "eslintConfig": { "extends": [
Unknown
있어요. 보통 타입스크립트 컴파일러에서 자동으로 해주는데... 타입스크립트 재시작(cursor의 restart typescript)해도 안되던가요?
@@ -19,7 +19,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "check": "npm run lint && tsc --noEmit && npm run build" }, "eslintConfig": { "extends": [
Unknown
gpt 물어보니 1. TypeScript 도입 2. ESLint & JSDoc 활용 3. APIClient의 메서드 인터페이스를 고정 4. 정적 분석 도구 (TypeScript, ESLint) 도입 이렇게 하라고 하네요. 흠 리스타트해도 안되는듯하네요?..
@@ -19,7 +19,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "check": "npm run lint && tsc --noEmit && npm run build" }, "eslintConfig": { "extends": [
Unknown
eslint를 설치해보는건 어떨까요? 흠
@@ -0,0 +1,12 @@ +.header { + display: flex; + justify-content: space-between; + align-items: center; + position: fixed; + width: calc(430px - 48px); + height: 64px; + padding: 0 24px; + background-color: black; + color: #fff; + z-index: 1000; +}
Unknown
피그마 시안 width가 430px이었고, 양 옆 padding이 24였어서 이런 calc 코드가 나왔습니다.. ✋🏻보통 이렇게 처리하시는지, 혹은 더 유연한 방식이 있는지 궁금합니다.
@@ -4,13 +4,15 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "vite", + "dev": "vite --host", "build": "tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", "test": "vitest" }, "depend...
Unknown
굉장히 사소하지만 커밋 메시지 관련 리뷰 남겨봅니다..! 저는 패키지 관련 설치는 chore를 사용합니다..! 이게 완벽하게 정확한 지는 검증해보지 않았으나, 참고해보면 좋을 것 같아요! [좋은 커밋 메시지 작성법](https://velog.io/@iamjm29/Git-%EC%A2%8B%EC%9D%80-%EC%BB%A4%EB%B0%8B-%EB%A9%94%EC%8B%9C%EC%A7%80-%EC%9E%91%EC%84%B1%EB%B2%95) [AngularJS Commit Convention](https://gist.github.com/stephenparish/...
@@ -0,0 +1,12 @@ +.header { + display: flex; + justify-content: space-between; + align-items: center; + position: fixed; + width: calc(430px - 48px); + height: 64px; + padding: 0 24px; + background-color: black; + color: #fff; + z-index: 1000; +}
Unknown
대박 왜 이제 알았지..? 👍
@@ -2,6 +2,7 @@ spring.application.name=delivery spring.jpa.hibernate.ddl-auto=update + spring.jpa.properties.hibernate.show_sql=true spring.jpa.properties.hibernate.format_sql=true spring.jpa.properties.hibernate.use_sql_comments=true
Unknown
여기 DB 민감정보 .env로 빼주실 수 있나요?? 디스코드에 제가 사용한 .env는 올려두었습니다!
@@ -0,0 +1,18 @@ +package racingcar.view; + +import camp.nextstep.edu.missionutils.Console; + +public class InputView { + private static final String ASK_CAR_NAMES = "경주할 자동차 이름을 입력하세요.(이름은 쉼표(,) 기준으로 구분)"; + private static final String ASK_TURN = "시도할 회수는 몇회인가요?"; + + public static String readCarNames() { + ...
Java
메시지 관리에 대해서 static이 좋은지 enum이 좋은지 이야기 나눠보면 좋을 것 같습니다. 항상 어떤게 나은지 고민해서 매번 쓸때마다 한번은 이렇게 한번은 저렇게 했었거든요.
@@ -0,0 +1,18 @@ +package racingcar.view; + +import camp.nextstep.edu.missionutils.Console; + +public class InputView { + private static final String ASK_CAR_NAMES = "경주할 자동차 이름을 입력하세요.(이름은 쉼표(,) 기준으로 구분)"; + private static final String ASK_TURN = "시도할 회수는 몇회인가요?"; + + public static String readCarNames() { + ...
Java
저는 System.out.print~사용하는 부분은 전부 출력으로 사용자에게 보여지는 부분이라고 생각해서 모두 OutputView에 작성하고 있습니다. 사실 첨에 저도 InputView에 써도 될지 고민했는데 이 부분에 대해서는 어떻게 생각하시는지 궁금합니다.
@@ -0,0 +1,38 @@ +package racingcar.view; + +import java.util.stream.Collectors; +import racingcar.domain.RacingCar; +import racingcar.domain.RacingCars; +import racingcar.domain.Winner; + +public class OutputView { + private static final String RACE_RESULT_MESSAGE = "\n실행 결과"; + private static final String DISTA...
Java
Winner클래스의 getWinner()에서 아래 연산이 끝난 결과를 리턴하면 getter를 사용하지 않고도 결과를 받아올 수 있다고 생각하는데 어떻게 생각하시나요?
@@ -0,0 +1,17 @@ +package racingcar.domain; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +class CarNameTest { + @Parameterized...
Java
assertThatCode를 이용해서 예외가 발생하지 않고 올바르게 되는지 한번 테스트 해보는 것도 추천 드립니다.
@@ -0,0 +1,22 @@ +package racingcar.domain; + +public enum ErrorMessage { + ERROR("[ERROR] "), + INVALID_NAME_LENGTH(ERROR + "차량 이름은 1-5글자 사이여야 합니다."), + INVALID_NAME_TYPE(ERROR + "차량 이름은 특수문자를 포함할 수 없습니다."), + DUPLICATED_NAME(ERROR + "차량 이름은 중복될 수 없습니다."), + INVALID_RACING_CARS_SIZE(ERROR + "경주에는 최소 2대의...
Java
ERROR은 변함 없을 것 같은데 상수로 두고 생성자 부분에서 this.message = "ERROR" + message로 한다면 메시지 작성할 때 중복을 피하는데 도움 될 것 같습니다.
@@ -0,0 +1,63 @@ +package racingcar.domain; + +import static racingcar.domain.ErrorMessage.CANT_FIND_CAR; +import static racingcar.domain.ErrorMessage.DUPLICATED_NAME; +import static racingcar.domain.ErrorMessage.INVALID_RACING_CARS_SIZE; + +import java.util.List; +import java.util.stream.Collectors; + +public class Ra...
Java
return에 바로 작성하면 가독성이 조금 떨어져 보일까요? 이 메소드 처럼 한번만 사용하는 변수라면 변수로 지정하지 않고 바로 작성해도 될 것 같은데... 이러면 가독성이 떨어져 보이기도 할 것 같아 고민이 되서 여쭤봅니다.
@@ -0,0 +1,51 @@ +package racingcar.domain; + +import static racingcar.domain.ErrorMessage.INVALID_NAME_LENGTH; +import static racingcar.domain.ErrorMessage.INVALID_NAME_TYPE; + +import java.util.Objects; +import java.util.regex.Pattern; + +public class CarName { + private static final int MAX_LENGTH = 5; + priva...
Java
정규표현식에 문자지정한 후 {1,5}을 사용하면 글자 수 제한 하는데도 도움이 될 거에요.
@@ -0,0 +1,35 @@ +package racingcar.domain; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; + +import java.util.List; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit...
Java
2대 이상인 경우 / 이름 중복되면 안되는 경우에 대해 메소드를 나눠서 테스트 해도 좋을거같슴다
@@ -0,0 +1,17 @@ +package racingcar.domain; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +class TurnTest { + @ParameterizedTes...
Java
저는 validate 로직에 대해서 1. 숫자만 입력 받아야하는 변수에 문자 입력되는 경우 -> input에서 검증 2. 1회 미만으로 입력받는 메소드 관련 검증 -> turn메소드에서 검증 하는 방식으로 항상 작성해 왔는데 이부분에 대해서 어떻게 생각하는지 궁금합니다 !
@@ -0,0 +1,18 @@ +package racingcar.view; + +import camp.nextstep.edu.missionutils.Console; + +public class InputView { + private static final String ASK_CAR_NAMES = "경주할 자동차 이름을 입력하세요.(이름은 쉼표(,) 기준으로 구분)"; + private static final String ASK_TURN = "시도할 회수는 몇회인가요?"; + + public static String readCarNames() { + ...
Java
저는 이번에 프리코스를 진행하면서 나름의 기준을 세워봤습니다! 1. enum으로 사용할만큼 상수의 개수가 충분한지? 최소 3개 이상 2. 프로그램이 확장된다면 해당 enum 에 상수가 추가될 가능성이 있는지? 3. 다른 클래스에서도 사용될 가능성이 있는지?
@@ -0,0 +1,18 @@ +package racingcar.view; + +import camp.nextstep.edu.missionutils.Console; + +public class InputView { + private static final String ASK_CAR_NAMES = "경주할 자동차 이름을 입력하세요.(이름은 쉼표(,) 기준으로 구분)"; + private static final String ASK_TURN = "시도할 회수는 몇회인가요?"; + + public static String readCarNames() { + ...
Java
저도 처음에 1주차 미션을 진행할 때는 사용자에게 보이는 부분이라고 생각하여 OutputView에 작성했었는데 많은 분들 코드를 보다보니 입력을 요청하는 메시지는 InputView에서 처리하시더라구요. 그리고 결정적으로 우테코에서 제공한 요구사항 부분을 보시면 입력을 요구하는 메시지를 InputView에서 사용하는걸 보실 수 있습니다. <img width="914" alt="image" src="https://github.com/parksangchu/java-racingcar-6/assets/142131857/87aa54ff-07c6-4c03-87fe-331d6ab...
@@ -0,0 +1,22 @@ +package racingcar.domain; + +public enum ErrorMessage { + ERROR("[ERROR] "), + INVALID_NAME_LENGTH(ERROR + "차량 이름은 1-5글자 사이여야 합니다."), + INVALID_NAME_TYPE(ERROR + "차량 이름은 특수문자를 포함할 수 없습니다."), + DUPLICATED_NAME(ERROR + "차량 이름은 중복될 수 없습니다."), + INVALID_RACING_CARS_SIZE(ERROR + "경주에는 최소 2대의...
Java
enum 생성자에 대한 이해가 부족했던것 같습니다 ! 좋은 조언 감사합니다 ㅎㅎ
@@ -0,0 +1,63 @@ +package racingcar.domain; + +import static racingcar.domain.ErrorMessage.CANT_FIND_CAR; +import static racingcar.domain.ErrorMessage.DUPLICATED_NAME; +import static racingcar.domain.ErrorMessage.INVALID_RACING_CARS_SIZE; + +import java.util.List; +import java.util.stream.Collectors; + +public class Ra...
Java
제가 3주차 미션을 할때 겪었던 에로사항이 메서드내 모든 코드를 축약을 시키다보니 나중에 제가 그 코드를 보았을때 무슨 코드인지 한눈에 알기가 힘들더군요 ㅜㅜ 그래서 4주차때부터는 어느정도 절제해서 축약을 해보니 가독성이 훨씬 높아졌었던 경험이 있어서 이번에도 이런 방식으로 진행을 해봤습니다!
@@ -0,0 +1,38 @@ +package racingcar.view; + +import java.util.stream.Collectors; +import racingcar.domain.RacingCar; +import racingcar.domain.RacingCars; +import racingcar.domain.Winner; + +public class OutputView { + private static final String RACE_RESULT_MESSAGE = "\n실행 결과"; + private static final String DISTA...
Java
받아온 데이터를 어떤식으로 처리할지 결정하는 것은 OutputView의 책임이라고 생각해서 해당 방식으로 진행했습니다~ 3주차 공통 피드백에서도 view에서 사용하는 데이터는 getter를 사용하라고 언급이 되어있구요! <img width="619" alt="image" src="https://github.com/parksangchu/java-racingcar-6/assets/142131857/99c1b2c6-7c6d-49ee-8154-e9d7c306bd0b">
@@ -0,0 +1,17 @@ +package racingcar.domain; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +class CarNameTest { + @Parameterized...
Java
처음 보는 메서드였는데 한번 사용해보겠습니다! 감사합니다 ㅎㅎ
@@ -0,0 +1,35 @@ +package racingcar.domain; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; + +import java.util.List; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit...
Java
코드를 줄이려고 너무 욕심을 내다보니 그만 ... ㅜ 아무래도 따로 테스트하는게 가독성 측면에서도 좋을거 같습니다
@@ -0,0 +1,17 @@ +package racingcar.domain; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +class TurnTest { + @ParameterizedTes...
Java
저도 원래는 그런 방식으로 검증을 진행해오다가 이번에 'InputView에서 domain에서 쓰일 데이터 형태를 아는게 맞을까?'하는 의문이 들어 해당 방식으로 진행을 해봤습니다. 그리고 'RacingCar'와 같은 해당 프로그램의 도메인에서 쓰이는 객체를 생성해서 넘기는 것만 아니라면 int와 같은 기본값 형태는 inputView에서 검증해도 괜찮겠다라는 결론을 냈습니다.
@@ -64,7 +64,7 @@ const BookFeedTab = ({ /> <Box sx={bookReviewTabStyles.sectionHeader}> <Typography variant="h6" fontWeight="bold"> - 한줄평 ({bookPostCount?.review_count}) + 한줄평 ({bookPostCount?.review_count || 0}) </Typography> <Button ...
Unknown
이 부분은 지워주시면 좋을 것 같습니다!
@@ -64,7 +64,7 @@ const BookFeedTab = ({ /> <Box sx={bookReviewTabStyles.sectionHeader}> <Typography variant="h6" fontWeight="bold"> - 한줄평 ({bookPostCount?.review_count}) + 한줄평 ({bookPostCount?.review_count || 0}) </Typography> <Button ...
Unknown
앗, 넵!
@@ -0,0 +1,11 @@ +package baseball.util; + +import java.util.Random; + +public class RamdomNumberGenerator { + private static final Random RANDOM = new Random(); + + public static Integer generate() { + return RANDOM.nextInt(9) + 1; + } +}
Java
무작위의 숫자를 생성하는 클래스를 따로 빼서 테스트를 용이하게 할 수 있게 한 게 좋네요!
@@ -0,0 +1,101 @@ +package baseball.domain; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class NumericBalls implements Iterable { + private List<NumericBall> numericBalls; + + public NumericBalls() { + numericBalls = new ArrayList<>(); + } + + publi...
Java
리스트에 넣고 맵에 다시 넣는 것보다 처음부터 필드를 맵으로 선언하고 맵의 숫자와 인덱스를 비교하면 효율이 더 좋을 것 같아요.
@@ -0,0 +1,23 @@ +package baseball.view; + +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; + +public class InputView { + private static final Scanner SCANNER = new Scanner(System.in); + public static List<Integer> inputNumbers() { + System.out.println("숫자를 입력해 주세요 : "); + List<Integer>...
Java
객체를 상수로 선언하면 코드가 훨씬 간편해지지만, final임에도 값이 바뀔 수 있어 관련이슈가 있을 수도 있습니다. 유의하고 사용해주세요:)
@@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <link rel="icon" type="image/svg+xml" href="/vite.svg" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>react-shopping-products</title> + <script type="module" crossorigin src=...
Unknown
dist 폴더가 git ignore되지 않았군용
@@ -0,0 +1,10 @@ +/** + * generateBasicToken - Basic auth를 위한 토큰을 만드는 함수입니다. + * @param {string} userId - USERNAME입니다. + * @param {string} userPassword - PASSWORD입니다. + * @returns {string} + */ +export function generateBasicToken(userId: string, userPassword: string): string { + const token = btoa(`${userId}:${userPas...
TypeScript
섬세한 jsdocs 👍👍👍👍
@@ -0,0 +1,95 @@ +import { CartItemType, ProductType } from '../types'; +import { generateBasicToken } from './auth'; + +const API_URL = import.meta.env.VITE_API_URL; +const USER_ID = import.meta.env.VITE_USER_ID; +const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD; + +/** + * 공통 요청을 처리하는 함수 + * @param {string} e...
TypeScript
공통 로직을 묶어주는 것 너무 좋습니다~!
@@ -0,0 +1,95 @@ +import { CartItemType, ProductType } from '../types'; +import { generateBasicToken } from './auth'; + +const API_URL = import.meta.env.VITE_API_URL; +const USER_ID = import.meta.env.VITE_USER_ID; +const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD; + +/** + * 공통 요청을 처리하는 함수 + * @param {string} e...
TypeScript
장바구니에 100개 넘게 담을 수 있는 case가 존재할 것 같아요~!
@@ -0,0 +1,50 @@ +.loaderContainer { + height: 60px; + display: flex; + justify-content: center; + align-items: center; +} + +.loader { + width: 60px; + display: flex; + justify-content: space-evenly; +} + +.ball { + list-style: none; + width: 12px; + height: 12px; + border-radius: 50%; + background-color: ...
Unknown
귀여운 애니메이션을 만들었군용 🚀🚀🚀
@@ -0,0 +1,15 @@ +export const productCategories = { + all: '전체', + fashion: '패션', + beverage: '음료', + electronics: '전자제품', + kitchen: '주방용품', + fitness: '피트니스', + books: '도서', +} as const; + +export const sortOptions = { priceAsc: '낮은 가격순', priceDesc: '높은 가격순' } as const; + +export const FIRST_FETCH_PAGE = 0; +...
TypeScript
상수화 👍👍👍
@@ -0,0 +1,32 @@ +import React, { createContext, useState, useCallback, ReactNode } from 'react'; +import ErrorToast from '../components/ErrorToast/ErrorToast'; + +export interface ToastContextType { + showToast: (message: string) => void; +} + +export const ToastContext = createContext<ToastContextType | undefined>(u...
Unknown
별도의 Provider로 만들어 준 것 너무 좋네요
@@ -0,0 +1,95 @@ +import { CartItemType, ProductType } from '../types'; +import { generateBasicToken } from './auth'; + +const API_URL = import.meta.env.VITE_API_URL; +const USER_ID = import.meta.env.VITE_USER_ID; +const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD; + +/** + * 공통 요청을 처리하는 함수 + * @param {string} e...
TypeScript
맞아요... 임시방편이었는데 그냥 까먹고 넘어갔네요 ㅜㅜ
@@ -0,0 +1,95 @@ +import { CartItemType, ProductType } from '../types'; +import { generateBasicToken } from './auth'; + +const API_URL = import.meta.env.VITE_API_URL; +const USER_ID = import.meta.env.VITE_USER_ID; +const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD; + +/** + * 공통 요청을 처리하는 함수 + * @param {string} e...
TypeScript
그런데.. 이번 장바구니 api는 20개만 담을 수 있게 만들어져있더라구요.. 지금 api 구현사항에 맞출지, 아니면 미래의 변경에도 용이하게 코드를 바꿀지는 생각해 봐야할 문제인 것 같아요. 이 부분을 바꿔야 한다면 위의 >if (key === 'category' && value === 'all') 이 코드에서도 default로 들어갈 수 있는 sort=id,asc도 생각해봐야 할 것 같고요
@@ -0,0 +1,21 @@ +import { SelectHTMLAttributes, PropsWithChildren } from 'react'; +import styles from './Select.module.css'; + +interface Props extends PropsWithChildren<SelectHTMLAttributes<HTMLSelectElement>> { + options: Record<string, string>; +} + +const Select = ({ options, defaultValue, children, ...props }: P...
Unknown
entries라는 함수도 있으니 찾아보시면 좋을 것 같아요..! ``` js Object.entries(options).map([optionEn,optionKo])=>{ ... } ```
@@ -3,28 +3,50 @@ import './Login.scss'; import Login_Button from './Login_Button/Login_Button'; class Login extends Component { + constructor(props) { + super(props); + this.state = { + id: 'a', + pw: 0, + }; + } + + handleInput = e => { + const { value, name } = e.target; + this.setSta...
JavaScript
this.state ... 이거 너무 기니까 이것도 비구조화 할당하시는 게 가독성이 좋을 것 같아요!
@@ -1,14 +1,51 @@ import React, { Component } from 'react'; +import Comment from './Comment/Comment'; import './Feeds.scss'; class Feeds extends Component { + constructor(props) { + super(props); + this.state = { + comment: '', + comments: [], + idnumber: 1, + }; + } + + componentDidMoun...
JavaScript
여기 form 태그로 감싸시고 onSubmit 이벤트주시면 엔터키 누를 때 실행되는 메소드 따로 안 만드셔도 pressButton 메소드 하나만으로 댓글 추가시킬 수 있어요!
@@ -3,28 +3,50 @@ import './Login.scss'; import Login_Button from './Login_Button/Login_Button'; class Login extends Component { + constructor(props) { + super(props); + this.state = { + id: 'a', + pw: 0, + }; + } + + handleInput = e => { + const { value, name } = e.target; + this.setSta...
JavaScript
말씀하신대로 바꿨습니다!
@@ -1,14 +1,51 @@ import React, { Component } from 'react'; +import Comment from './Comment/Comment'; import './Feeds.scss'; class Feeds extends Component { + constructor(props) { + super(props); + this.state = { + comment: '', + comments: [], + idnumber: 1, + }; + } + + componentDidMoun...
JavaScript
form에 이런 기능이 있는 줄 처음알았습니다! 덕분에 새로운 지식을 얻었습니다. 정말 감사해요!
@@ -3,28 +3,50 @@ import './Login.scss'; import Login_Button from './Login_Button/Login_Button'; class Login extends Component { + constructor(props) { + super(props); + this.state = { + id: 'a', + pw: 0, + }; + } + + handleInput = e => { + const { value, name } = e.target; + this.setSta...
JavaScript
idValue를 넘겨주는 걸로 보이는데 idfunc라는 이름은 마치 함수같아서 적합하지 않아보입니다! pwfunc, colorfunc 모두 마찬가지입니다! 그리고 colorfunc라는 값은 id랑 pw통해서 계산 가능해보이는데 그러면 idValue랑 pwValue만 Props로 받고, colorfunc에서 계산 하는 값은 LoginButton 컴포넌트에서 props통해서 바로 계산해서 사용해도 무방해보입니다!
@@ -1,14 +1,51 @@ import React, { Component } from 'react'; +import Comment from './Comment/Comment'; import './Feeds.scss'; class Feeds extends Component { + constructor(props) { + super(props); + this.state = { + comment: '', + comments: [], + idnumber: 1, + }; + } + + componentDidMoun...
JavaScript
api주소가 data안에 들어있는 형태는 비정상적인 것 같습니다! api주소는 일반적으로 백엔드에서 전송해주지 않습니다! comment정보랑 feed정보를 분리시켜놓으셔서 그런 것 같은데, feed안에 comment정보를 그냥 다 넣어주시면 될 것 같습니다! ``` { id: 1, profilesrc: '/images/jaesangChoi/profile1.jpeg', mainfeedsrc: 'https://images.unsplash.com/photo-1623659993428-0c5504a16ca5?ixid=Mnw...
@@ -1,14 +1,51 @@ import React, { Component } from 'react'; +import Comment from './Comment/Comment'; import './Feeds.scss'; class Feeds extends Component { + constructor(props) { + super(props); + this.state = { + comment: '', + comments: [], + idnumber: 1, + }; + } + + componentDidMoun...
JavaScript
get method는 기본값이라서 따로 기입안해주셔도 됩니다!
@@ -1,14 +1,51 @@ import React, { Component } from 'react'; +import Comment from './Comment/Comment'; import './Feeds.scss'; class Feeds extends Component { + constructor(props) { + super(props); + this.state = { + comment: '', + comments: [], + idnumber: 1, + }; + } + + componentDidMoun...
JavaScript
댓글은 나중에 삭제될 수도 있으니까 id를 length로 사용하면 삭제 후 다시 추가되는 경우 동일한 id를 가진 댓글이 생길 것 같습니다!
@@ -1,14 +1,51 @@ import React, { Component } from 'react'; +import Comment from './Comment/Comment'; import './Feeds.scss'; class Feeds extends Component { + constructor(props) { + super(props); + this.state = { + comment: '', + comments: [], + idnumber: 1, + }; + } + + componentDidMoun...
JavaScript
함수는 return문 따로 없으면 끝까지 다 읽고나서 알아서 종료되기때문에 임의로 return 키워드를 적을 필요는 없어보입니다!
@@ -1,14 +1,51 @@ import React, { Component } from 'react'; +import Comment from './Comment/Comment'; import './Feeds.scss'; class Feeds extends Component { + constructor(props) { + super(props); + this.state = { + comment: '', + comments: [], + idnumber: 1, + }; + } + + componentDidMoun...
JavaScript
여기는 alt를 한글로 적고 다른 곳은 영어로 적으신 이유가 있으실까요?? 영어로 적어주시는게 좋아보입니다! 한글이 더 좋지만,, 만국 공용어가 영어기 때문에 보편성을 위해서 😂
@@ -1,14 +1,51 @@ import React, { Component } from 'react'; +import Comment from './Comment/Comment'; import './Feeds.scss'; class Feeds extends Component { + constructor(props) { + super(props); + this.state = { + comment: '', + comments: [], + idnumber: 1, + }; + } + + componentDidMoun...
JavaScript
t라는 변수명을 가지고는 여기에 할당된 값이 뭐일지 전혀 유추가 안되는 것 같습니다! comments 배열안의 하나하나의 요소들이니까 comment라고 이름지어주는게 좋지 않을까요? ```suggestion {comments.map(comment => { ```
@@ -1,14 +1,51 @@ import React, { Component } from 'react'; +import Comment from './Comment/Comment'; import './Feeds.scss'; class Feeds extends Component { + constructor(props) { + super(props); + this.state = { + comment: '', + comments: [], + idnumber: 1, + }; + } + + componentDidMoun...
JavaScript
마찬가지로 pressButton이라는 이름만 보고는 전혀 유추가 안됩니다! pressButton이라는건 발생하는 시점이지 함수가 하고있는 동작이 아니기 때문에 함수의 역할을 동사형으로 명확하게 addComment 등으로 이름지어주는게 좋아보입니다!
@@ -5,15 +5,49 @@ import Main_right from './Main_right/Main_right'; import './Main.scss'; class Mainjaesang extends Component { + constructor(props) { + super(props); + this.state = { + feedslist: [], + }; + } + + callApi = () => { + fetch('http://localhost:3000/data/JaesangChoi/FeedsData.json')...
JavaScript
feedslist안의 하나의 요소들인데 flist라는 변수명은 적합하지 않은것 같습니다! 차라리 feed등이 좀 더 적합하고 의미가 드러나 보이네요!
@@ -5,15 +5,49 @@ import Main_right from './Main_right/Main_right'; import './Main.scss'; class Mainjaesang extends Component { + constructor(props) { + super(props); + this.state = { + feedslist: [], + }; + } + + callApi = () => { + fetch('http://localhost:3000/data/JaesangChoi/FeedsData.json')...
JavaScript
메인 콘텐츠 구획을 의미하는 거라면 div tag보다는 main tag가 좀 더 적합하지 않을까요?
@@ -1,31 +1,15 @@ - - -body { - margin: 0px; - overflow: hidden; - +main { + display: flex; + justify-content: center; + gap: 20px; + padding-top: 54px; + box-sizing: border-box; + + .bold_comment { + font-weight: bold; + } + + .grey_comment { + color: grey; + } } - - - -.main { - display: flex...
Unknown
이미 display:block인 요소인데 width:100% 를 부여할 이유가 없어보입니다!
@@ -1,31 +1,15 @@ - - -body { - margin: 0px; - overflow: hidden; - +main { + display: flex; + justify-content: center; + gap: 20px; + padding-top: 54px; + box-sizing: border-box; + + .bold_comment { + font-weight: bold; + } + + .grey_comment { + color: grey; + } } - - - -.main { - display: flex...
Unknown
height:100vh로 부모태그의 크기를 고정값으로 정하는건 좋지않습니다! 부모태그에 고정높이값을 주는건 스크롤이 필요한 경우를 제외하고는 지양하고있습니다! 안에 여러 자식태그들이 들어올텐데 그 크기만큼 자연스럽게 늘어나도록 height값을 주지 않는게 좋아보입니다!
@@ -1,9 +1,25 @@ import React, { Component } from 'react'; -import Recommendation_list from './Recommendation_list/Recommendation_list'; +import RecommendationList from './Recommendation_list/Recommendation_list'; +import RECOMMENDATION_DATA from './RecommendationData'; import './Main_right.scss'; class Main_right...
JavaScript
상수데이터는 대문자 + snake_case 사용해주세요!
@@ -1,9 +1,25 @@ import React, { Component } from 'react'; -import Recommendation_list from './Recommendation_list/Recommendation_list'; +import RecommendationList from './Recommendation_list/Recommendation_list'; +import RECOMMENDATION_DATA from './RecommendationData'; import './Main_right.scss'; class Main_right...
JavaScript
camelCase 사용해주세요! 지금은 pascalCase를 사용하고 계시네요!
@@ -1,9 +1,25 @@ import React, { Component } from 'react'; -import Recommendation_list from './Recommendation_list/Recommendation_list'; +import RecommendationList from './Recommendation_list/Recommendation_list'; +import RECOMMENDATION_DATA from './RecommendationData'; import './Main_right.scss'; class Main_right...
JavaScript
camelCase 사용해주세요!
@@ -1,31 +1,15 @@ - - -body { - margin: 0px; - overflow: hidden; - +main { + display: flex; + justify-content: center; + gap: 20px; + padding-top: 54px; + box-sizing: border-box; + + .bold_comment { + font-weight: bold; + } + + .grey_comment { + color: grey; + } } - - - -.main { - display: flex...
Unknown
main.scss에서 main태그에 height: 100vh를 준 이유가 화면 전체를 범위를 갖게 해주려고 사용했습니다. 그 이유는 Main_right의 박스가 Nav처럼 고정된걸 구현하려고 했고 그 방법으로 position:sticky가 떠올랐기 때문입니다. sticky로 화면에 계속 고정시키기 위해선 화면 전체에 대해서 범위를 가져야하는데 Main_right는 main태그의 자식이기 때문에 main태그가 화면전체의 범위를 가져야 했습니다. 그래서 main에 height:100vh를 줬습니다아... height를 auto로 설정하면 position:sti...
@@ -1,31 +1,15 @@ - - -body { - margin: 0px; - overflow: hidden; - +main { + display: flex; + justify-content: center; + gap: 20px; + padding-top: 54px; + box-sizing: border-box; + + .bold_comment { + font-weight: bold; + } + + .grey_comment { + color: grey; + } } - - - -.main { - display: flex...
Unknown
라운지에 계실 때 여쭤보길 잘한거 같습니다. 덕분에 position:sticky에 대해서 착각했던게 완전히 잡혔습니다. 더이상 position은 두렵지 않네요!!!
@@ -0,0 +1,44 @@ +package christmas.controller; + +import christmas.domain.event.EventCalculator; +import christmas.domain.date.ReservationDate; +import christmas.domain.order.OrderMenuParser; +import christmas.view.InputView; +import christmas.view.OutputView; + +public class ChristmasController { + public void run...
Java
한 메서드에서 너무 복잡해 보이네요 메서드를 분리하면 더 좋을거 같아요!