code
stringlengths
41
34.3k
lang
stringclasses
8 values
review
stringlengths
1
4.74k
@@ -0,0 +1,18 @@ +export interface PageInfoData { + title: string; + description: string; + src: string; +} + +export interface PageNavData { + id: string; + label: string; + icon?: string; + active: boolean; + subItems?: PageNavData[]; +} + +export interface FilteringData { + label: string; + value: string; +}
TypeScript
[p5] type 파일을 따로 분리해서 가독성이 좋아졌네요~😁
@@ -0,0 +1,16 @@ +export interface ReviewScore { + teamId: number; + gatheringId: number; + type: string; + averageScore: number; + oneStar: number; + twoStars: number; + threeStars: number; + fourStars: number; + fiveStars: number; +} + +export interface GetReviewsParams { + gatheringId?: string; + type?: '' | 'DALLAE...
TypeScript
[p5] type 파일을 따로 분리해서 보기 좋습니다~!🐱
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import styled from "@emotion/styled"; import { css, Theme } from "@emotion/react"; import CheckIcon from "components/inputs/TextInput/CheckIcon"; -import { TConditionCheck } from "./types/TConditionCheck"; +import { TConditionCheck } from "component...
Unknown
사소하지만 `height ?? "auto"` 도 괜찮을 것 같아요!
@@ -0,0 +1,170 @@ +import styled from "@emotion/styled"; +import IconStarFilled from "components/rating/icons/IconStarFilled"; +import IconStarHalf from "components/rating/icons/IconStarHalf"; +import IconStarOutlined from "components/rating/icons/IconStarOutlined"; +import { HTMLAttributes, useEffect, useState, useRef...
Unknown
오 이 컴포넌트는 아직 Rating쪽이 머지 되지 않아서 일부 내용을 그대로 가지고 오신 부분인가용~? (+ `isInput` 모드 추가로요?)
@@ -0,0 +1,170 @@ +import styled from "@emotion/styled"; +import IconStarFilled from "components/rating/icons/IconStarFilled"; +import IconStarHalf from "components/rating/icons/IconStarHalf"; +import IconStarOutlined from "components/rating/icons/IconStarOutlined"; +import { HTMLAttributes, useEffect, useState, useRef...
Unknown
오... 뛰어난 사용성일 것 같습니다 😆 수고하셨습니다!
@@ -0,0 +1,120 @@ +import styled from "@emotion/styled"; +import Image from "next/image"; +import { useState } from "react"; +import Rating from "components/rating/Rating"; +import IconEditFilledWhite from "components/icons/IconEditFilledWhite"; +import Link from "next/link"; +import dayjs from "dayjs"; + +interface Pr...
Unknown
오..! 저희가 `dayjs` 도 쓰고 있어서 활용해보시는 것도 좋을 것 같습니다! 이런 경우 ```tsx import dayjs from 'dayjs'; const formattedDate= dayjs(date).format("YY/MM/DD") ``` 이렇게 활용해볼 수도 있을 것 같습니다~
@@ -0,0 +1,120 @@ +import styled from "@emotion/styled"; +import Image from "next/image"; +import { useState } from "react"; +import Rating from "components/rating/Rating"; +import IconEditFilledWhite from "components/icons/IconEditFilledWhite"; +import Link from "next/link"; +import dayjs from "dayjs"; + +interface Pr...
Unknown
`className` 은 따로 컨벤션이 있는 것은 아니지만 대부분 kebab case 를 적용하고 있어 `user-info-score-div` 이런 식은 어떨까요~?
@@ -0,0 +1,105 @@ +import styled from "@emotion/styled"; +import RestaurantExternalLinkIcon from "feature/restaurants/restaurantsDetail/components/icons/RestaurantExternalLinkIcon"; +import Link from "next/link"; + +interface Props { + restaurantId: string; + userAuth?: number; + restaurantName: string; + restauran...
Unknown
이 `restaurantId` 가 `string[]` 도 받게 하신 이유가 있을까요~?
@@ -0,0 +1,105 @@ +import styled from "@emotion/styled"; +import RestaurantExternalLinkIcon from "feature/restaurants/restaurantsDetail/components/icons/RestaurantExternalLinkIcon"; +import Link from "next/link"; + +interface Props { + restaurantId: string; + userAuth?: number; + restaurantName: string; + restauran...
Unknown
앗 여기도 `over-title-div` 이렇게 가 어떨까요 !
@@ -0,0 +1,105 @@ +import styled from "@emotion/styled"; +import RestaurantExternalLinkIcon from "feature/restaurants/restaurantsDetail/components/icons/RestaurantExternalLinkIcon"; +import Link from "next/link"; + +interface Props { + restaurantId: string; + userAuth?: number; + restaurantName: string; + restauran...
Unknown
여기는 이 페이지에서 거의 메인 급 제목인 것 같은데 `<h1 />` 태그 정도로 사용하면 어떨까요~? 아래는 레퍼런스용 [페이스북] 의 멤버 상세 페이지인데 서비스 제목 (저희로 치면 '쩝쩝대학') 은 `<h2/>` 태그, 유저 이름은 `<h1/>` 으로 사용한 것 같습니다. 저희도 오히려 상단 navbar 에서 [쩝쩝대학] 을 `<h2 />` 로 바꾸고 맛집이나 단체 상세 페이지에서 맛집이름, 단체이름은 `<h1/>` 에 넣으면 semantic tagging 뿐만 아니라 SEO 에도 도움이 될 것 같습니다! cc. @hoon5083 ![i...
@@ -0,0 +1,85 @@ +import styled from "@emotion/styled"; +import Image from "next/image"; +import { useState } from "react"; +import Button from "components/button/Button"; + +interface Props { + imgSrcList: string[]; +} + +const RestaurantDetailImgSection: React.FC<Props> = ({ imgSrcList }) => { + const [currentImgIn...
Unknown
혹시 이 버튼은 화면상의 어느 부분인가용~? 로컬에서 돌렸을 때 노출되지 않는 것 같습니다! ![image](https://github.com/SystemConsultantGroup/foodhub-frontend/assets/86560973/c705c6dd-3624-40d6-8639-8764bd45609d)
@@ -0,0 +1,70 @@ +import styled from "@emotion/styled"; +import RestaurantDetailImgSection from "feature/restaurants/restaurantsDetail/components/section/RestaurantDetailImgSection"; +import RestaurantDetailHeaderSection from "feature/restaurants/restaurantsDetail/components/section/RestaurantDetailHeaderSection"; +imp...
Unknown
임시 코드인가요!? 객체구조 분해로 받아오는 것도 좋을 것 같습니다! ```tsx const { totalScore, totalCount, totalPages, scoreStatistics } = reviewPage1 ```
@@ -0,0 +1,137 @@ +import styled from "@emotion/styled"; +import Rating from "components/rating/Rating"; +import RestaurantDetailHeaderSection from "feature/restaurants/restaurantsDetail/components/section/RestaurantDetailHeaderSection"; +import Button from "components/button/Button"; +import TextInput from "components...
Unknown
오타가 있는 것 같습니다!
@@ -0,0 +1,137 @@ +import styled from "@emotion/styled"; +import Rating from "components/rating/Rating"; +import RestaurantDetailHeaderSection from "feature/restaurants/restaurantsDetail/components/section/RestaurantDetailHeaderSection"; +import Button from "components/button/Button"; +import TextInput from "components...
Unknown
요 값을 `src/constant/limit.ts` 에서 관리해주는 것은 어떨까요~? 하나의 파일에서 각 최대길이나 최소길이 조건 등을 관리해주면 나중에 이를 증가 또는 감소시킬 일이 있을 때 대응하기 용이할 것 같습니다!
@@ -0,0 +1,18 @@ +import styled from "@emotion/styled"; +import RestaurantsReviewForm from "feature/restaurants/restaurantsReview/components/form/RestaurantsReviewForm"; + +interface Props { + restaurantId: string; +} + +const ViewRestaurantReviewCreate: React.FC<Props> = ({ restaurantId }) => { + return ( + <Emot...
Unknown
여기서도 `string []` 을 특별히 추가해주신 이유가 있을까요~?
@@ -0,0 +1,170 @@ +import styled from "@emotion/styled"; +import IconStarFilled from "components/rating/icons/IconStarFilled"; +import IconStarHalf from "components/rating/icons/IconStarHalf"; +import IconStarOutlined from "components/rating/icons/IconStarOutlined"; +import { HTMLAttributes, useEffect, useState, useRef...
Unknown
넵 맞습니다..!
@@ -0,0 +1,85 @@ +import styled from "@emotion/styled"; +import Image from "next/image"; +import { useState } from "react"; +import Button from "components/button/Button"; + +interface Props { + imgSrcList: string[]; +} + +const RestaurantDetailImgSection: React.FC<Props> = ({ imgSrcList }) => { + const [currentImgIn...
Unknown
앗 이미지 슬라이더를 구현하려다가 일단 PR부터 올렸는데, 해당 버튼은 그 과정에서 생긴 별 의미 없는 버튼입니다.. 삭제하도록 하겠습니다!
@@ -0,0 +1,70 @@ +import styled from "@emotion/styled"; +import RestaurantDetailImgSection from "feature/restaurants/restaurantsDetail/components/section/RestaurantDetailImgSection"; +import RestaurantDetailHeaderSection from "feature/restaurants/restaurantsDetail/components/section/RestaurantDetailHeaderSection"; +imp...
Unknown
확인 감사합니다. 수정했습니다!
@@ -0,0 +1,137 @@ +import styled from "@emotion/styled"; +import Rating from "components/rating/Rating"; +import RestaurantDetailHeaderSection from "feature/restaurants/restaurantsDetail/components/section/RestaurantDetailHeaderSection"; +import Button from "components/button/Button"; +import TextInput from "components...
Unknown
발견 감사합니다! 수정했습니다.
@@ -0,0 +1,137 @@ +import styled from "@emotion/styled"; +import Rating from "components/rating/Rating"; +import RestaurantDetailHeaderSection from "feature/restaurants/restaurantsDetail/components/section/RestaurantDetailHeaderSection"; +import Button from "components/button/Button"; +import TextInput from "components...
Unknown
넵 좋습니다! 수정했습니다.
@@ -0,0 +1,85 @@ +import styled from "@emotion/styled"; +import Image from "next/image"; +import { useState } from "react"; +import Button from "components/button/Button"; + +interface Props { + imgSrcList: string[]; +} + +const RestaurantDetailImgSection: React.FC<Props> = ({ imgSrcList }) => { + const [currentImgIn...
Unknown
이미지 슬라이더는 아직 구현하지 않았지만, 일단 이미지 전환이 가능하도록 버튼은 만들어두었습니다! 지금은 버튼 보일 겁니다.
@@ -0,0 +1,105 @@ +import styled from "@emotion/styled"; +import RestaurantExternalLinkIcon from "feature/restaurants/restaurantsDetail/components/icons/RestaurantExternalLinkIcon"; +import Link from "next/link"; + +interface Props { + restaurantId: string; + userAuth?: number; + restaurantName: string; + restauran...
Unknown
오.. 넵 다른 페이지도 메인이 되는 텍스트(맛집 이름, 단체 이름)은 `<h1 />`을 사용하도록 수정하겠습니다. 일단 맛집 상세 페이지에서는 맛집 이름을 `<h1 />` 태그로 수정 완료하였습니다.
@@ -0,0 +1,105 @@ +import styled from "@emotion/styled"; +import RestaurantExternalLinkIcon from "feature/restaurants/restaurantsDetail/components/icons/RestaurantExternalLinkIcon"; +import Link from "next/link"; + +interface Props { + restaurantId: string; + userAuth?: number; + restaurantName: string; + restauran...
Unknown
className을 모두 kebab case로 수정완료하였습니다!
@@ -0,0 +1,120 @@ +import styled from "@emotion/styled"; +import Image from "next/image"; +import { useState } from "react"; +import Rating from "components/rating/Rating"; +import IconEditFilledWhite from "components/icons/IconEditFilledWhite"; +import Link from "next/link"; +import dayjs from "dayjs"; + +interface Pr...
Unknown
className을 모두 kebab case로 수정완료하였습니다!
@@ -0,0 +1,120 @@ +import styled from "@emotion/styled"; +import Image from "next/image"; +import { useState } from "react"; +import Rating from "components/rating/Rating"; +import IconEditFilledWhite from "components/icons/IconEditFilledWhite"; +import Link from "next/link"; +import dayjs from "dayjs"; + +interface Pr...
Unknown
오 넵 감사합니다. 해당 방식으로 수정 완료하였습니다!
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import styled from "@emotion/styled"; import { css, Theme } from "@emotion/react"; import CheckIcon from "components/inputs/TextInput/CheckIcon"; -import { TConditionCheck } from "./types/TConditionCheck"; +import { TConditionCheck } from "component...
Unknown
넵 수정했습니다!
@@ -0,0 +1,105 @@ +import styled from "@emotion/styled"; +import RestaurantExternalLinkIcon from "feature/restaurants/restaurantsDetail/components/icons/RestaurantExternalLinkIcon"; +import Link from "next/link"; + +interface Props { + restaurantId: string; + userAuth?: number; + restaurantName: string; + restauran...
Unknown
restaurantId를 받아올 때 `const restaurantId = query.restaurantId ?? 0;` 이렇게만 했더니 props로 넘겨줄 때 타입 에러가 떠서 저렇게 설정한건데, 현재는 `const restaurantId = (query.restaurantId ?? 0) as string;` 아예 이런 식으로 타입을 명시해주어서 props로 받아올 때에도 string으로만 받아오도록 수정했습니다!
@@ -0,0 +1,18 @@ +import styled from "@emotion/styled"; +import RestaurantsReviewForm from "feature/restaurants/restaurantsReview/components/form/RestaurantsReviewForm"; + +interface Props { + restaurantId: string; +} + +const ViewRestaurantReviewCreate: React.FC<Props> = ({ restaurantId }) => { + return ( + <Emot...
Unknown
[여기](https://github.com/SystemConsultantGroup/foodhub-frontend/pull/27#discussion_r1373127345)에서 이유를 설명하였고, 해당 부분 string으로만 받아오도록 수정했습니다!
@@ -0,0 +1,170 @@ +import styled from "@emotion/styled"; +import IconStarFilled from "components/rating/icons/IconStarFilled"; +import IconStarHalf from "components/rating/icons/IconStarHalf"; +import IconStarOutlined from "components/rating/icons/IconStarOutlined"; +import { HTMLAttributes, useEffect, useState, useRef...
Unknown
별점을 drag하여 입력할 수 있도록 추가적으로 구현하였는데, 데스크톱에서는 잘 되는데 모바일에서는 touchMove 이벤트가 중간에 끊기는 현상이 발생하였습니다. 정확히는 touchMove 도중에 state를 세팅하면, 터치는 이어지고 있는 상황인데도 touchMove가 인식되지 않습니다. selectedValue가 바뀌면서 star들이 다시 렌더링되는 것 때문인 것 같지만 정확히 뭐 때문인지는 모르겠습니다. 현재 해결 방안을 찾는 중이긴 한데, 하다가 안되면 이슈로 올리도록 하겠습니다.. @jaychang99 @hoon5083
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
리액트 관련 라이브러리 import가 더 우선순위에 위치해야 할 것 같습니다!
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
import './Login.scss'; 위로 가야될 것 같습니다!! 😎
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
수정완료 😊
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
- variable.scss 는 scss 파일에서 사용하는 것이기 때문에 js 에서 import 를 하는 것이 의미가 없습니다. - scss 파일에서 변수를 사용하는 경우에 import 해주세요!
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
- 두 함수는 하는 역할이 비슷하기 때문에 충분히 하나의 함수로 합쳐볼 수 있을 것 같습니다. - Refactoring CheckList 참고해서 수정해 보세요!
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
- isActive 는 id 와 pw 로 계산할 수 있는 값이이기 때문에 state 로 관리할 필요가 없어 보입니다! - 아래 공식 문서 참고하셔서 어떤 값들이 state 로 적절하지 않은지 파악해보시기 바랍니다! https://www.notion.so/wecode/Westagram-React-Refactoring-Checklist-aea297cf88ed4601b769e4b2c2cfd4e1#089493d6bfca438aa328226e327cff92
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
- isActive 를 state 로 관리할 필요 없이, 여기서 바로 true / false 를 계산하면 될 것 같습니다!
@@ -1,3 +1,106 @@ -*{ - margin: 0; -} \ No newline at end of file +@import '../../../styles/variable.scss'; + +.Login { + @include flexCenter; + flex-direction: column; + align-items: center; + height: 100vh; + + .loginBox { + display: flex; + flex-direction: column; + justify-content: space-between; +...
Unknown
- css 작업을 하실때 바깥 요소에 특정한 width / height 값을 부여하시는 것 보다, 바깥 요소의 크기는 내용물의 크기 + margin / padding 들의 합으로 자연스럽게 크기가 결정되도록 하시는 게 더 좋습니다. - 항상 bottom up 방식으로 스타일링 하는 습관을 들여주세요!
@@ -0,0 +1,26 @@ +import React from 'react'; +import './Aside.scss'; + +import ProfileWrap from './ProfileWrap/ProfileWrap'; +import StoryBox from './StoryBox/StoryBox'; +import RecommendBox from './RecommendBox/RecommendBox'; +import WestaInfoBox from './WestaInfoBox/WestaInfoBox'; + +class Aside extends React.Compone...
JavaScript
- Import 순서 수정해주세요! 일반적인 convention을 따르는 이유도 있지만 순서만 잘 지켜주셔도 가독성이 좋아집니다. 아래 순서 참고해주세요. - React → Library(Package) → Component → 변수 / 이미지 → css 파일(scss 파일) ```suggestion import React from 'react'; import ProfileWrap from './ProfileWrap/ProfileWrap'; import StoryBox from './StoryBox/StoryBox'; import RecommendBox f...
@@ -0,0 +1,56 @@ +import React from 'react'; +import './Content.scss'; + +import Feed from './Feed/Feed'; +import Aside from './Aside/Aside'; + +class Content extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() { + fetch('http://local...
JavaScript
- `http://localhost:3000` 은 생략 가능합니다. 포트 번호가 달라지면(ex. `localhost:3001`) fetch 함수를 일일이 수정해주어야 하기 때문에 유지보수가 어려워집니다. 아래 코드 참고해서 수정해주세요! ```jsx const foo = () => { // fetch("http://localhost:3000/images/1") fetch("/images/1") } ``` - fetch함수의 `get method`는 method의 default 값입니다. 따라서 생략이 가능합니다. ```jsx const foo =...
@@ -0,0 +1,56 @@ +import React from 'react'; +import './Content.scss'; + +import Feed from './Feed/Feed'; +import Aside from './Aside/Aside'; + +class Content extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() { + fetch('http://local...
JavaScript
- mock up 데이터의 키 값은 스네이크 케이스로 사용해주셔도 되지만 (백엔드에서는 보통 스네이크 케이스를 쓰기 때문에) props 의 이름은 카멜 케이스로 통일해 주세요!
@@ -0,0 +1,210 @@ +import 'package:flutter/material.dart'; + +class ReviewView extends StatelessWidget { + const ReviewView({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: _appBar(context), + floatingActionButtonLocation: FloatingActionButtonLocation.endFl...
Unknown
플로팅 버튼 제거하셔도 됩니다. 이전 PR 참고해주세요.
@@ -5,13 +5,15 @@ import com.somemore.domains.review.dto.response.ReviewDetailResponseDto; import com.somemore.domains.review.dto.response.ReviewDetailWithNicknameResponseDto; import com.somemore.domains.review.usecase.ReviewQueryUseCase; +import com.somemore.global.auth.annotation.RoleId; import com.somemore.globa...
Java
빌더 로직을 컨디션 클래스의 of 정적 메서드에서 진행하면 더 깔끔할 것 같아요~ 굳이 수정할 필요는 없다고 생각합니다!
@@ -1,35 +1,34 @@ package com.somemore.domains.review.service; -import com.somemore.domains.center.usecase.query.CenterQueryUseCase; +import static com.somemore.global.exception.ExceptionMessage.NOT_EXISTS_REVIEW; + import com.somemore.domains.review.domain.Review; import com.somemore.domains.review.dto.condition....
Java
메서드로 코드를 포장하면 가독성이 더 좋을 것 같아요~
@@ -1,35 +1,34 @@ package com.somemore.domains.review.service; -import com.somemore.domains.center.usecase.query.CenterQueryUseCase; +import static com.somemore.global.exception.ExceptionMessage.NOT_EXISTS_REVIEW; + import com.somemore.domains.review.domain.Review; import com.somemore.domains.review.dto.condition....
Java
복수형 정적 팩토리 메서드
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
구조분해할당을 잘 쓰신거 같습니다!
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
comment관련 함수를 깔끔하게 잘 정리하신거 같습니다
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
커멘트 컴포넌트에 프롭스 전달을 깔끔하게 잘 하신거 같습니다
@@ -1,10 +1,94 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import './Login.scss'; class Login extends React.Component { + constructor() { + super(); + this.state = { + loginId: '', + loginPassword: '', + }; + } + + handleLoginInput = e => { + const { value, na...
JavaScript
삼항연산자 사용을 잘 하신거 같습니다.
@@ -1,10 +1,178 @@ import React from 'react'; +import Nav from '../../../components/Nav/Nav'; +import Feed from '../../../components/Feed/Feed'; +import './Main.scss'; + class Main extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() ...
JavaScript
Lifecycle Method를 잘 사용하신거 같습니다.
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
저도 적용해보겠습니다!👍
@@ -1,10 +1,94 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import './Login.scss'; class Login extends React.Component { + constructor() { + super(); + this.state = { + loginId: '', + loginPassword: '', + }; + } + + handleLoginInput = e => { + const { value, na...
JavaScript
버튼이 활성화될 때 색상 변경과 비활성화 기능까지 구현하신 점 배워갑니다:)
@@ -0,0 +1,74 @@ +[ + { + "id": 1, + "userName": "bbangho", + "alt": "wecode", + "img": "/images/youngho/hanRiver.jpeg", + "comment": [ + { + "id": 1, + "userName": "bbangho", + "content": "한강 다녀감~ ✌️", + "isLiked": true + }, + { + "id": 2, + "use...
Unknown
목데이터 사용 너무 좋습니다! :)
@@ -1,10 +1,94 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import './Login.scss'; class Login extends React.Component { + constructor() { + super(); + this.state = { + loginId: '', + loginPassword: '', + }; + } + + handleLoginInput = e => { + const { value, na...
JavaScript
```suggestion <button onClick={this.handleLogin} className={condition ? 'buttonActivate' : 'buttonDisabled'} id="loginButton" disabled={ condition ? false : true} > 로그인 </button> ``` 해당 조건...
@@ -1,10 +1,94 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import './Login.scss'; class Login extends React.Component { + constructor() { + super(); + this.state = { + loginId: '', + loginPassword: '', + }; + } + + handleLoginInput = e => { + const { value, na...
JavaScript
참고로 위의 변수는 render 함수 내에서 선언해주시면 됩니다!!
@@ -0,0 +1,78 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +body { + background-color: #fafafa; +} + +.container { + text-align: center; + width: 600px; + height: 600px; + margin: 50px auto 0 auto; + border: 1px solid #e6e6e6; + background-color: white; +} + +.header { + padding:...
Unknown
```suggestion body { background-color: #fafafa; } .container { text-align: center; border: 1px solid #e6e6e6; background-color: white; width: 600px; height: 600px; margin: 50px auto 0 auto; } .header { font-family: 'Lobster', cursive; font-size: 70px; font-weight: 1px; padding:...
@@ -0,0 +1,78 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +body { + background-color: #fafafa; +} + +.container { + text-align: center; + width: 600px; + height: 600px; + margin: 50px auto 0 auto; + border: 1px solid #e6e6e6; + background-color: white; +} + +.header { + padding:...
Unknown
영호님! 전체적으로 CSS 속성 순서 확인해서 적용해주세요~ - 하나의 요소에 여러가지 속성을 부여하는 경우 중요도, 관련도에 따라서 나름의 convention을 지켜서 작성하는 것이 좋습니다. - 일반적인 convention 은 아래와 같습니다. 아래와 같이 순서 적용해주세요. [CSS property 순서] - Layout Properties (position, float, clear, display) - Box Model Properties (width, height, margin, padding) - Visual ...
@@ -1,10 +1,178 @@ import React from 'react'; +import Nav from '../../../components/Nav/Nav'; +import Feed from '../../../components/Feed/Feed'; +import './Main.scss'; + class Main extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() ...
JavaScript
import 순서는 잘 맞춰주셨고, 해당 부분에서는 줄바꿈 없이 진행해주세요~
@@ -1,10 +1,178 @@ import React from 'react'; +import Nav from '../../../components/Nav/Nav'; +import Feed from '../../../components/Feed/Feed'; +import './Main.scss'; + class Main extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() ...
JavaScript
fetch함수의 `get method는 method의 default` 값입니다. 따라서 `생략이 가능`합니다. 고로 get method 요청시에는 아래와 같이 두번째 인자가 생략 가능합니다. ```jsx const foo = () => { fetch(`${cartAPI}/quantity`) .then((res) => res.json()) ```
@@ -1,10 +1,178 @@ import React from 'react'; +import Nav from '../../../components/Nav/Nav'; +import Feed from '../../../components/Feed/Feed'; +import './Main.scss'; + class Main extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() ...
JavaScript
story 부분이 여러번 반복되고 있네요! 상수 데이터와 map을 사용해서 중복된 부분을 줄여주세요! ``` const STORIES = [ {img: "//", name: "wecorder1"}, {img: "//", name: "wecorder2"}, {img: "//", name: "wecorder3"} ]; STORIES.map(); ```
@@ -0,0 +1,285 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +@media screen and (max-width: 1200px) { + .mainRight { + display: none; + } + + .article { + width: 100%; + } +} + +body { + margin: 0; + padding: 0; + border-collapse: collapse; +} + +article { + width: 800px; + ...
Unknown
반응형 아주 좋네요!! 브레이크 포인트는 기획마다 달라지지만 보통 태블릿과 데스크탑의 구분점은 1078px이라는 점 알아두세요! 모바일과 태블릿은 768px입니다!
@@ -0,0 +1,285 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +@media screen and (max-width: 1200px) { + .mainRight { + display: none; + } + + .article { + width: 100%; + } +} + +body { + margin: 0; + padding: 0; + border-collapse: collapse; +} + +article { + width: 800px; + ...
Unknown
같은 스타일의 경우에는 중복하여 주시지 말고 같은 클래스명을 사용하셔도 됩니다!
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
import 구분은 너무 좋지만 줄바꿈은 안하셔도 됩니다!!!
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
이렇게 구조분해할당 너무 좋네요!!
@@ -0,0 +1,74 @@ +[ + { + "id": 1, + "userName": "bbangho", + "alt": "wecode", + "img": "/images/youngho/hanRiver.jpeg", + "comment": [ + { + "id": 1, + "userName": "bbangho", + "content": "한강 다녀감~ ✌️", + "isLiked": true + }, + { + "id": 2, + "use...
Unknown
감사합니다!
@@ -1,10 +1,94 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import './Login.scss'; class Login extends React.Component { + constructor() { + super(); + this.state = { + loginId: '', + loginPassword: '', + }; + } + + handleLoginInput = e => { + const { value, na...
JavaScript
반영 완료했습니다!
@@ -0,0 +1,78 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +body { + background-color: #fafafa; +} + +.container { + text-align: center; + width: 600px; + height: 600px; + margin: 50px auto 0 auto; + border: 1px solid #e6e6e6; + background-color: white; +} + +.header { + padding:...
Unknown
반영 완료했습니다!
@@ -0,0 +1,78 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +body { + background-color: #fafafa; +} + +.container { + text-align: center; + width: 600px; + height: 600px; + margin: 50px auto 0 auto; + border: 1px solid #e6e6e6; + background-color: white; +} + +.header { + padding:...
Unknown
반영 완료했습니다!
@@ -1,10 +1,178 @@ import React from 'react'; +import Nav from '../../../components/Nav/Nav'; +import Feed from '../../../components/Feed/Feed'; +import './Main.scss'; + class Main extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() ...
JavaScript
반영 완료했습니다!
@@ -1,10 +1,178 @@ import React from 'react'; +import Nav from '../../../components/Nav/Nav'; +import Feed from '../../../components/Feed/Feed'; +import './Main.scss'; + class Main extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() ...
JavaScript
반영 완료했습니다!
@@ -0,0 +1,285 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +@media screen and (max-width: 1200px) { + .mainRight { + display: none; + } + + .article { + width: 100%; + } +} + +body { + margin: 0; + padding: 0; + border-collapse: collapse; +} + +article { + width: 800px; + ...
Unknown
감사합니다!
@@ -0,0 +1,285 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +@media screen and (max-width: 1200px) { + .mainRight { + display: none; + } + + .article { + width: 100%; + } +} + +body { + margin: 0; + padding: 0; + border-collapse: collapse; +} + +article { + width: 800px; + ...
Unknown
반영 완료했습니다!
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
반영 완료했습니다!
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
감사합니다 🌝
@@ -0,0 +1,17 @@ +from django.db import models + +class User(models.Model): + email = models.EmailField(max_length=50, unique=True) + password = models.CharField(max_length=100) + relation = models.ManyToManyField('self', through='Follow', symmetrical=False) + + class Meta: + db_table = "users" + ...
Python
다민님! 잘 작성해주셨는데 `email` 은 겹칠 수 없는 정보이기 때문에 해당하는 옵션을 추가해주시는게 좋습니다! 알아보시고 알맞은 옵션을 추가해주세요~
@@ -0,0 +1,10 @@ +from django.urls import path +from .views import SignupView, LoginView, FollowView + +urlpatterns = [ + path('/user', SignupView.as_view()), + path('/login', LoginView.as_view()), + path('/follow', FollowView.as_view()), + +] +'''Error가 아니라 django의 권장사항. 하지만 패턴 컨벤션에는 위 사항이 맞다.'''
Python
import 하실 때 `*` 사용하지 마시고 명확하게 가져오고 싶은 class 를 적어주세요!
@@ -0,0 +1,10 @@ +from django.urls import path +from .views import SignupView, LoginView, FollowView + +urlpatterns = [ + path('/user', SignupView.as_view()), + path('/login', LoginView.as_view()), + path('/follow', FollowView.as_view()), + +] +'''Error가 아니라 django의 권장사항. 하지만 패턴 컨벤션에는 위 사항이 맞다.'''
Python
이 부분 세션 중 한번 설명 드렸는데, 왜 `/` 관련 warning 이 뜬다고 생각하시나요!?
@@ -0,0 +1,21 @@ +"""westagram URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.hom...
Python
이 부분은 위코드 url 패턴 컨벤션에 맞지 않습니다. 위에 리뷰드린 내용 중 `/` 관련 질문 남겨드렸으니 확인해주세요.
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
깔끔하네요~! 💯
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
`json.loads()` 도 핸들해주셔야하는 exception 이 발생할 수 있습니다. 확인해보시고 추가해주세요!
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
다민님이 작성하신 코드 로직을 순서대로 정리해보겠습니다. 1. `client` 에서 들어온 `email`, `password` 값을 이용하여 일치하는 user 를 filter 하는 쿼리를 날려 user 변수에 저장해준다. 2. `email` 로 filter 쿼리를 날려 존재하는 user 인지 확인한다. 3. `password` 로 filter 쿼리를 날려 존재하는 user 인지 확인한다. 4. client 에서 들어온 `email`, `password` 가 유효한 포맷인지 검사하여 유효하다면 CREATE 를 진행한다. 이렇게 말로 정리해보니 흐름이 좀 어...
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
여기서 잠깐 질문! `KeyError` 어떤 에러이며, 언제 발생할까요?
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
SignupView 와 비슷한 로직 흐름이네요. 위쪽 남겨드린 질문 먼저 확인해주세요!
@@ -0,0 +1,17 @@ +from django.db import models + +class User(models.Model): + email = models.EmailField(max_length=50, unique=True) + password = models.CharField(max_length=100) + relation = models.ManyToManyField('self', through='Follow', symmetrical=False) + + class Meta: + db_table = "users" + ...
Python
`from django.db import models class User(models.Model): email = models.EmailField(max_length=50, unique=True)` 로 해결했습니다.
@@ -0,0 +1,10 @@ +from django.urls import path +from .views import SignupView, LoginView, FollowView + +urlpatterns = [ + path('/user', SignupView.as_view()), + path('/login', LoginView.as_view()), + path('/follow', FollowView.as_view()), + +] +'''Error가 아니라 django의 권장사항. 하지만 패턴 컨벤션에는 위 사항이 맞다.'''
Python
`from django.urls import path from .views import SignupView, LoginView` 로 필요한 뷰 클래스 가져오는 것으로 수정하였습니다.
@@ -0,0 +1,10 @@ +from django.urls import path +from .views import SignupView, LoginView, FollowView + +urlpatterns = [ + path('/user', SignupView.as_view()), + path('/login', LoginView.as_view()), + path('/follow', FollowView.as_view()), + +] +'''Error가 아니라 django의 권장사항. 하지만 패턴 컨벤션에는 위 사항이 맞다.'''
Python
Error가 아니라 django의 권장사항이어서 그렇습니다. 하지만 패턴 컨벤션에는 고쳐서 쓰는 것이 맞기 때문에 고쳤습니다.
@@ -0,0 +1,21 @@ +"""westagram URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.hom...
Python
수정하였습니다.
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
`class SignupView(View): def post(self, request): try: data = json.loads(request.body) user = User.objects.filter(email=data['email'],password=data['password'])` 아래 로그인뷰도 똑같은 형태로 바꿨습니다. 이유 : 사용자에게 형식을 받을 때 꼭 내가 원하는 형태로 json이 오지 않을 수 있기에 Key-error 상황을 줘야 하기 때문.
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
이거 택향님하고 이야기하다가 안 것인데, 키 에러란 딕셔너리 형태에서 자주 발생하며 딕셔너리 내부에 존재하지 않는 키를 사용해서 값을 내려고 할 때 나는 에러입니다. 이번 예시로는 만일 데이터가 email=~~~ password=~~~ 로 오는 것이 아니라 emailadkfj=~~~ apsdkfjsa=~~~처럼 키 내용이 잘못 와버리는 경우 예외 처리로 키 에러를 내기 위해 하는 것으로 의도하고 했습니다!
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
확인했습니다
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
먼저 두 클래스 모두 공통적으로 user라는 변수가 불필요해서 지웠습니다. - 이유 : 이미 User.~를 통해 쿼리를 날려 데이터에서 필요한 자료를 가져올 수 있다. 불필요한 변수였다. - comment : 1. client에서 들어온 값 중 이메일 필터 쿼리를 날려 존재하는 이메일일 경우인지 확인. 2. (마찬가지로) 비밀번호 필터 쿼리를 날려 존재하는 비밀번호인지 확인. 3. 이메일과 비밀번호가 유효한 포맷인지 검사하여 유효하면 값 만들기 진행. - 아직 쿼리를 날린다는 개념이 확실히 서지 않아 표현이 맞는건지는 모르겠습니다. 문법적인 점은 검토해...
@@ -0,0 +1,17 @@ +from django.db import models + +class User(models.Model): + email = models.EmailField(max_length=50, unique=True) + password = models.CharField(max_length=100) + relation = models.ManyToManyField('self', through='Follow', symmetrical=False) + + class Meta: + db_table = "users" + ...
Python
`unique=True` 굳입니다!!
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
@damin0320 정확합니다 다민님!
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
가독성을 위해 로직별로 분리해서 띄어쓰기로 구분해주세요! 지금은 너무 다 붙어있어서 읽기가 좋은 코드가 아닙니다 다민님!
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
exists() 활용 gooood 👍
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
이 부분은 로직이 조금 이상한데요. password 는 고유값이 아니고, 같은 password 를 가진 유저정보들이 충분히 존재할 수 있는데 password 로 필터를 걸어줄 필요는 없다고 생각합니다~
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
암호화 과정 적용 정말 잘하셨습니다!
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
create() 뒤에 save() 는 불필요합니다 다민님. 없애주세요!
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
get() 메소드를 사용하시면 꼭 잡아주셔야하는 exception 들이 있습니다. 알아보시고 exception handling 로직에 추가해주세요!
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
여기도 마찬가지로 가독성을 위해 로직을 블록으로 구분하여 한줄씩 추가해주세요!
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
이야~ jwt 생성 로직까지 너무 잘 적용하셨네요! 하지만 생성을 완료했는데 생성만하고 사용을 안하고 계시네요. 다음 스텝은 무엇일까요?