inflearn logo
강의

Course

Instructor

Learn React and Firebase by following along - Creating a Chat Application [Renewed in December 2023]

Creating a message component

안뇽하세요 강사님

225

작성자 없음

0 asked

0

다름이아니라 react bootstrap에서 이제 Media를 지원하지 않는거같은데 어떤걸로 대체하면 좋을까 알 수 있을까요?

 

React-Bootstrap · React-Bootstrap Documentation

 

웹앱 firebase react

Answer 2

0

wjdtjrdn65096

감사합니다~~

0

John Ahn

안녕하세요 !!! 

Media가 없어진걸 알려주셔서 너무 감사합니다 !!! 
우선 Media가 쓰인곳이     Message.js와   MessageHeader.js  두곳이네요 ! 

먼저 Message.js에서는 

<div style={{ marginBottom: '3px', display:'flex' }}>
<img
style={{ borderRadius: '10px' }}
width={48}
height={48}
className="mr-3"
src={message.user.image}
alt={message.user.name}
/>
<div style={{
backgroundColor: isMessageMine(message, user) && "#ECECEC"
}}>
<h6>{message.user.name}{" "}
<span style={{ fontSize: '10px', color: 'gray' }}>
{timeFromNow(message.timestamp)}
</span>
</h6>
{isImage(message) ?
<img style={{ maxWidth: '300px' }} alt="이미지" src={message.image} />
:
<p>
{message.content}
</p>
}
</div>
</div>

이렇게 바꿔주세요 !!!   

그리고 MessageHeader에서는 

const renderUserPosts = (userPosts) =>
Object.entries(userPosts)
.sort((a, b) => b[1].count - a[1].count)
.map(([key, val], i) => (
<div key={i} style={{ display: 'flex'}}>
<img
style={{ borderRadius: 25 }}
width={48}
height={48}
className="mr-3"
src={val.image}
alt={val.name}
/>
<div>
<h6>{key}</h6>
<p>
{val.count}
</p>
</div>
</div>
))


이렇게 바꿔주시면 감사하겠습니다 ! 

Media를   div 태그로 바꿔주고  display:'flex' 스타일을 주었습니다 ! 

감사합니다.

ESlint

0

134

1

현 강의자료는 이해는 했는데, 그럼 전 강의자료는 이젠 활용을 못하나요?

0

98

0

배포 후 빈페이지

0

149

1

notification 관련 질문에 AI가 엉뚱하게 대답하여 다시 질문합니다.

0

140

1

notification 관련 부분은 예전 강의를 들어야 하나요?

0

143

1

npm run build시 오류가 있습니다.

0

225

1

이미지 업로드시 403에러가 발생하는데 해결법이 있을까요?

0

777

1

이건 어디에 저장이 되는 것인가요?? redux에 저장이 되는 것인가요??

0

256

1

eslint 질문 있습니다.

0

234

1

npm create react app

0

314

2

[리덕스 미들웨어]강의 중에 createStore에서 막혔습니다.

0

528

3

회원가입 유효성 부분 페이지 안뜨는 이유 좀요....

0

284

1

강의 pdf 파일

0

435

2

파이어베이스 파일 삭제, 사진 업로드 기능 오류

0

330

1

firebase 초기화 오류

0

596

1

mime-types 패키지를 import 할 때 에러 발생

0

280

1

리덕스 스토어에 로그인 유저 정보가 저장이 되지 않는 문제

0

340

1

강의 리뉴얼 일정을 알 수 있을까요?

0

370

1

완성본으로 제공된 코드를 구동시켜보려면

2

408

1

DB와 강의 리뉴얼

0

505

1

next.js 환경에서 이 수업을 들을 수 있나요?

0

391

1

Cannot read properties of undefined (reading 'isLoading') 오류 해결법 혹시 알 수 있을까요...

0

512

1

addChatRoom 함수 작성시

0

279

1

강의 도표 자료 다운을 받으면, zip파일에 아무것도 들어있지않다고 나옵니다.

0

247

1