Skip to content
Next Next commit
New changes with randomQuestion
  • Loading branch information
Shashank5665 committed Aug 20, 2022
commit 9e1106a269a4f811ce3ce53c0649d2a38fad3c8a
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions src/components/Table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,26 @@ const Table = () => {
},
Filter: SelectColumnFilter,
},
// button to display a random question
{
randomQuestion: () => {
const random = Math.floor(Math.random() * questions.length);
const questionId = questions[random].id;
return questionId;
},
Header: () => {
return (
<Button
onClick={() => {}}
color="success"
id="random-question-button"
>
Random Question
</Button>
);
},
accessor: 'randomQuestion',
},
],
},
],
Expand Down