aboutsummaryrefslogtreecommitdiff
path: root/src/Pages/ProfilePage/ProfilePage.tsx
blob: ee95769be4eb24c9fff3c621f1d31efffd7a9436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React from 'react';
import { User } from '../../types';
import SignInForm from './SignInForm';
import ProfileInfo from './ProfileInfo';
import Feed from '../../components/Feed/Feed';

interface PropTypes {
  setUser: (newUser: User | undefined) => void;
  user: User | undefined;
}

const ProfilePage: React.FC<PropTypes> = ({ setUser, user }) => {
  return (
    user
      ? (
        <>
          <ProfileInfo id={user?._id} setUser={setUser} />
          <Feed page="Feed" />
        </>
      )
      : <SignInForm setUser={setUser} />
  );
};

export default ProfilePage;