aboutsummaryrefslogtreecommitdiff
path: root/src/Feed/Feed.tsx
diff options
context:
space:
mode:
authorilyayudovin <ilyayudovin123.@mail.com>2020-06-07 19:10:15 +0300
committerilyayudovin <ilyayudovin123.@mail.com>2020-06-07 19:10:15 +0300
commiteea76a129c7e8001eca00037e5915c79ed685169 (patch)
tree2a49f217fb43defa399f065f04fbb7aa89264978 /src/Feed/Feed.tsx
parent4e4c9d529e6f70e7dac84aaecb5b6a25769c3290 (diff)
downloadwhich-ui-eea76a129c7e8001eca00037e5915c79ed685169.tar.gz
feat: add Feed and fucntionality for creating polls
Diffstat (limited to 'src/Feed/Feed.tsx')
-rw-r--r--src/Feed/Feed.tsx29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Feed/Feed.tsx b/src/Feed/Feed.tsx
new file mode 100644
index 0000000..03ba6c0
--- /dev/null
+++ b/src/Feed/Feed.tsx
@@ -0,0 +1,29 @@
+import React from 'react';
+import { makeStyles } from '@material-ui/core/styles';
+import { Poll } from '../types';
+import PollCard from '../PollCard/PollCard';
+
+interface PropTypes {
+ polls: Poll[],
+}
+
+const usedStyles = makeStyles(() => ({
+ feed: {
+ maxWidth: 600,
+ margin: '0 auto'
+ }
+}));
+
+const Feed: React.FC<PropTypes> = ({ polls }) => {
+ const classes = usedStyles();
+
+ return (
+ <div className={classes.feed}>
+ {
+ polls.map(poll => <PollCard author={poll.author} contents={poll.contents} />)
+ }
+ </div>
+ );
+};
+
+export default Feed;