Skip to content
Prev Previous commit
Next Next commit
function name change
  • Loading branch information
Shashank5665 committed Aug 21, 2022
commit ccd724b5bb76e53c1f1a9b5e2c0a9678dea2b7e1
5 changes: 3 additions & 2 deletions src/components/Table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,12 @@ const Table = () => {
},
{
Header: () => {
const randomQuestion = () => {
const randomQuestionId = () => {
const random = Math.floor(Math.random() * questions.length);
const questionId = questions[random].id;
const questionSlug = questions[questionId].url;
window.open(`${questionSlug}`, '_blank');
return questionId;
};
return (
<>
Expand All @@ -220,7 +221,7 @@ const Table = () => {
>
Questions{' '}
<Button
onClick={randomQuestion}
onClick={randomQuestionId}
color="dark"
id="random-question-button"
size="sm"
Expand Down