From 1ac600e2fd9024604d98c525957cd2fbfdf9a779 Mon Sep 17 00:00:00 2001 From: ilyayudovin Date: Fri, 12 Jun 2020 18:29:51 +0300 Subject: feat: take user info from database --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 5fd57f0..530cd82 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -75,7 +75,7 @@ const App: React.FC = () => {
{ - page === 'profile' && + page === 'profile' && }
-- cgit v1.2.3 From 282bd3180b149571cfc5caad98d8b462596157ef Mon Sep 17 00:00:00 2001 From: ilyayudovin Date: Fri, 12 Jun 2020 19:41:54 +0300 Subject: fix: clear eslint errors --- src/index.tsx | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 530cd82..9fb34cb 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -21,42 +21,6 @@ const theme = createMuiTheme({ } }); -const polls = [{ - author: { - name: 'John Doe', - avatarUrl: '' - }, - contents: { - left: { - // eslint-disable-next-line max-len - url: 'https://images.pexels.com/photos/556666/pexels-photo-556666.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500', - votes: 15 - }, - right: { - // eslint-disable-next-line max-len - url: 'https://cdn.psychologytoday.com/sites/default/files/field_blog_entry_images/2019-06/pexels-photo-556667.jpeg', - votes: 17 - } - } -}, { - author: { - name: 'John Doe', - avatarUrl: '' - }, - contents: { - left: { - // eslint-disable-next-line max-len - url: 'https://images.pexels.com/photos/556666/pexels-photo-556666.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500', - votes: 15 - }, - right: { - // eslint-disable-next-line max-len - url: 'https://cdn.psychologytoday.com/sites/default/files/field_blog_entry_images/2019-06/pexels-photo-556667.jpeg', - votes: 17 - } - } -}]; - const useStyles = makeStyles({ root: { width: theme.spacing(75), @@ -75,7 +39,7 @@ const App: React.FC = () => {
{ - page === 'profile' && + page === 'profile' && }
-- cgit v1.2.3 From 0d878909fe17311910f2ba13e203bdfa1bc72a1e Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 12 Jun 2020 19:58:36 +0300 Subject: feat: fetch default user --- src/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 9fb34cb..adf44a5 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -13,6 +13,8 @@ import Header from './Header/Header'; import Feed from './Feed/Feed'; import ProfileInfo from './ProfileInfo/ProfileInfo'; +import { get } from './requests'; + const theme = createMuiTheme({ palette: { primary: { @@ -31,15 +33,20 @@ const useStyles = makeStyles({ const App: React.FC = () => { const [page, setPage] = useState('feed'); + const [id, setId] = useState(''); const classes = useStyles(); + get('/users').then(response => { + setId(response.data[0]._id); + }); + return (
{ - page === 'profile' && + page === 'profile' && }
-- cgit v1.2.3