99import Toggle from 'react-toggle' ;
1010import ReactTooltip from 'react-tooltip' ;
1111import { useTable , useFilters , useSortBy } from 'react-table' ;
12- import { FaQuestionCircle , FaLock } from 'react-icons/fa' ;
12+ import { FaLock , FaExternalLinkAlt , FaQuestionCircle } from 'react-icons/fa' ;
1313import {
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 ,
0 commit comments