kimsojung318 / movie-app

1 stars 0 forks source link

#8 영화 출연진들 가져오기 #9

Open kimsojung318 opened 3 years ago

kimsojung318 commented 3 years ago
  1. 가져온 Crew 정보 State에 넣기 1) Endpoint 사용하여 정보 가져오기 ${API_URL}movie/${movieId}/credits?api_key=${API_KEY}

    2) State 넣기

        const [Casts, setCasts] = useState([]);
        setCasts(response.cast)
  2. State에 보관된 Date들을 화면에 노출 1) MovieDetail.js

    • GridCards Component 사용

    2) GridCards.js

    • LandingPage.js GridCards Component에 "landingPage" props 추가
    • "landingPage" 여부에 따라 다른 return

    2) "Toggle Actor View" 버튼

    • "ActorToggle" State 추가 const [ActorToggle, setActorToggle] = useState(false);

    • "toggleActorView" 메소드 추가 const toggleActorView = () => { setActorToggle(!ActorToggle) }

    • "ActorToggle" 여부에 따라 cast GridCard 노출 {ActorToggle && ~중략}

kimsojung318 commented 3 years ago
  1. 오류 1) 내용

    • Updating a style property during rerender (background) when a conflicting property is set (backgroundPosition) can lead to styling bugs

    2) 해결방법 : MainImage.js

    • background → backgroundImage + backgroundColor 분리