@@ -15,7 +15,9 @@ export function Page() {
1515export function StratPage ( { show } ) {
1616 const { res } = useData ( ) ;
1717 console . log ( "res" , res ) ;
18- const startingID = show ? res [ res ?. length - 1 ] ?. concept_id : res [ res ?. length - 1 ] ?. strat_name_id ;
18+ const startingID = show
19+ ? res [ res ?. length - 1 ] ?. concept_id
20+ : res [ res ?. length - 1 ] ?. strat_name_id ;
1921
2022 const [ input , setInput ] = useState ( "" ) ;
2123 const [ showConcepts , setShowConcepts ] = useState ( show ?? false ) ;
@@ -43,8 +45,8 @@ export function StratPage({ show }) {
4345
4446 const result = useStratData ( lastID , input , pageSize , data_route , like ) ;
4547
46- console . log ( lastID )
47- console . log ( "data" , data )
48+ console . log ( lastID ) ;
49+ console . log ( "data" , data ) ;
4850
4951 const prevInputRef = useRef ( input ) ;
5052 const prevShowConceptsRef = useRef ( showConcepts ) ;
@@ -64,16 +66,17 @@ export function StratPage({ show }) {
6466 }
6567 } , [ input , showConcepts ] ) ;
6668
67-
6869 useEffect ( ( ) => {
6970 if (
70- result &&
71- data [ data . length - 1 ] ?. [ showConcepts ? "concept_id" : "strat_name_id" ] !== result [ result . length - 1 ] ?. [ showConcepts ? "concept_id" : "strat_name_id" ]
71+ result &&
72+ data [ data . length - 1 ] ?. [ showConcepts ? "concept_id" : "strat_name_id" ] !==
73+ result [ result . length - 1 ] ?. [
74+ showConcepts ? "concept_id" : "strat_name_id"
75+ ]
7276 ) {
7377 setData ( ( prevData ) => {
74- return [ ...prevData , ...result ] ;
75- }
76- ) ;
78+ return [ ...prevData , ...result ] ;
79+ } ) ;
7780 }
7881 } , [ result ] ) ;
7982
@@ -87,7 +90,8 @@ export function StratPage({ show }) {
8790 h ( StickyHeader , { className : "header" } , [
8891 h ( PageBreadcrumbs , { title } ) ,
8992 h ( "div.header-description" , [
90- h ( Card ,
93+ h (
94+ Card ,
9195 {
9296 className : ! showConcepts ? "selected" : "unselected" ,
9397 onClick : ( ) => {
@@ -96,14 +100,15 @@ export function StratPage({ show }) {
96100 setLastID ( 0 ) ;
97101 setData ( [ ] ) ;
98102 }
99- }
103+ } ,
100104 } ,
101105 [
102106 h ( "strong" , "Strat Names: " ) ,
103107 h ( "span" , "names of rock units, organized hierarchically" ) ,
104108 ]
105- ) ,
106- h ( Card ,
109+ ) ,
110+ h (
111+ Card ,
107112 {
108113 className : showConcepts ? "selected" : "unselected" ,
109114 onClick : ( ) => {
@@ -112,8 +117,8 @@ export function StratPage({ show }) {
112117 setLastID ( 0 ) ;
113118 setData ( [ ] ) ;
114119 }
115- }
116- } ,
120+ } ,
121+ } ,
117122 [
118123 h ( "strong" , "Strat Concepts: " ) ,
119124 h (
0 commit comments