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 32abbbc

Browse filesBrowse files
author
Sean Prashad
authored
Add solutions column (seanprashad#72)
* Remove duplicate Google entry from Word Search II company list * Add solutions column with hyperlinks to Leetcode Discuss solutions The "Name" column has been renamed to "Questions" where each question is now a hyperlink to the respective Leetcode URL.
1 parent 818b430 commit 32abbbc
Copy full SHA for 32abbbc

File tree

Expand file treeCollapse file tree

2 files changed

+24
-12
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+24
-12
lines changed

‎src/components/Table/index.js

Copy file name to clipboardExpand all lines: src/components/Table/index.js
+24-11Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import Toggle from 'react-toggle';
1010
import ReactTooltip from 'react-tooltip';
1111
import { useTable, useFilters, useSortBy } from 'react-table';
12-
import { FaQuestionCircle, FaLock } from 'react-icons/fa';
12+
import { FaLock, FaExternalLinkAlt, FaQuestionCircle } from 'react-icons/fa';
1313
import {
1414
DefaultColumnFilter,
1515
SelectDifficultyColumnFilter,
@@ -105,13 +105,15 @@ const Table = () => {
105105
totalDifficultyCount.Hard}
106106
</span>
107107
</Badge>
108+
<br />
108109
<Badge className="easy" pill>
109110
<span
110111
data-tip={`You've completed ${difficultyCount.Easy}/${totalDifficultyCount.Easy} easy questions`}
111112
>
112113
Easy: {difficultyCount.Easy}/{totalDifficultyCount.Easy}
113114
</span>
114115
</Badge>
116+
<br />
115117
<Badge className="medium" pill>
116118
<span
117119
data-tip={`You've completed ${difficultyCount.Medium}/${totalDifficultyCount.Medium} medium questions`}
@@ -120,6 +122,7 @@ const Table = () => {
120122
{totalDifficultyCount.Medium}
121123
</span>
122124
</Badge>
125+
<br />
123126
<Badge className="hard" pill>
124127
<span
125128
data-tip={`You've completed ${difficultyCount.Hard}/${totalDifficultyCount.Hard} hard questions`}
@@ -154,11 +157,21 @@ const Table = () => {
154157
},
155158
},
156159
{
157-
Header: 'Name',
158-
accessor: 'name',
160+
Header: 'Questions',
161+
accessor: 'questions',
159162
Cell: cellInfo => {
160163
return (
161-
<span>
164+
<NavLink
165+
target="_blank"
166+
href={cellInfo.row.original.url}
167+
onClick={() => {
168+
Event(
169+
'Table',
170+
'Clicked question url',
171+
`${cellInfo.row.original.name} question url`,
172+
);
173+
}}
174+
>
162175
{cellInfo.row.original.premium ? (
163176
<span data-tip="Requires leetcode premium to view">
164177
<FaLock />{' '}
@@ -167,26 +180,26 @@ const Table = () => {
167180
''
168181
)}
169182
{cellInfo.row.original.name}
170-
</span>
183+
</NavLink>
171184
);
172185
},
173186
},
174187
{
175-
Header: 'URL',
176-
accessor: 'url',
188+
Header: 'Solutions',
189+
accessor: 'solutions',
177190
Cell: cellInfo => (
178191
<NavLink
179192
target="_blank"
180-
href={cellInfo.row.original.url}
193+
href={`${cellInfo.row.original.url}discuss`}
181194
onClick={() => {
182195
Event(
183196
'Table',
184-
'Clicked url',
185-
`${cellInfo.row.original.name} url`,
197+
'Clicked solution',
198+
`${cellInfo.row.original.name} solution`,
186199
);
187200
}}
188201
>
189-
{cellInfo.row.original.url}
202+
<FaExternalLinkAlt />
190203
</NavLink>
191204
),
192205
disableFilters: true,

‎src/data/index.js

Copy file name to clipboardExpand all lines: src/data/index.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,6 @@ const questions = [
18041804
'Uber',
18051805
'Snapchat',
18061806
'Google',
1807-
'Google',
18081807
'Oracle',
18091808
],
18101809
},

0 commit comments

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