Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4af578f

Browse filesBrowse files
author
Sean
authored
Show lock icon for Leetcode Premium questions (seanprashad#19)
* Add lock icon to signify leetcode premium questions Fixes seanprashad#11 * Add `Premium` field to each question This new field will represent whether or not a question requires leetcode premium to view, and also allow users to filter by all, premium, or free questions. * Move Premium to its own column
1 parent ce12d85 commit 4af578f
Copy full SHA for 4af578f

File tree

Expand file treeCollapse file tree

2 files changed

+188
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+188
-1
lines changed

‎src/components/Table/index.js

Copy file name to clipboardExpand all lines: src/components/Table/index.js
+17-1Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from 'reactstrap';
99
import ReactTooltip from 'react-tooltip';
1010
import { useTable, useFilters, useSortBy } from 'react-table';
11-
import { FaQuestionCircle } from 'react-icons/fa';
11+
import { FaQuestionCircle, FaLock } from 'react-icons/fa';
1212
import { Event } from '../Shared/Tracking';
1313

1414
import questionList from '../../data';
@@ -67,6 +67,22 @@ const Table = () => {
6767
);
6868
},
6969
},
70+
{
71+
id: 'Premium',
72+
Cell: cellInfo => {
73+
return (
74+
<span>
75+
{cellInfo.row.original.premium ? (
76+
<span data-tip="Requires leetcode premium">
77+
<FaLock />{' '}
78+
</span>
79+
) : (
80+
''
81+
)}
82+
</span>
83+
);
84+
},
85+
},
7086
{
7187
Header: 'Name',
7288
accessor: 'name',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.