더북(TheBook)

이어서 ArticleView 컴포넌트는 다음과 같이 수정하세요.

components/ArticleView.tsx

import React from 'react';
import {View, StyleSheet, Text} from 'react-native';
import ArticleActionButtons from './ArticleActionButtons';

export interface ArticleViewProps {
  title: string;
  body: string;
  publishedAt: string;
  username: string;
  id: number;
  isMyArticle: boolean;
}

function ArticleView({
  title,
  body,
  publishedAt,
  username,
  id,
  isMyArticle,
}: ArticleViewProps) {
  (...)
    <View style={styles.separator} />
      {isMyArticle && <ArticleActionButtons articleId={id} />}
      <Text>{body}</Text>
    </View>
  );
}

(...)
신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.