-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8eec59
commit 2808edd
Showing
8 changed files
with
61,725 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import styles from "./component.module.css" | ||
import React from "react"; | ||
import {taxonomy} from "@/app/taxonomy"; | ||
|
||
export default function Taxonomy_list(ctx: { | ||
family: string, | ||
}) { | ||
let bread: string[] = [] | ||
let lst: React.JSX.Element[][] = [] | ||
let tax = taxonomy[ctx.family]; | ||
let n: string = ctx.family | ||
let r = tax["r"] | ||
bread.push(n) | ||
while (true) { | ||
let nn = tax["p"]; | ||
tax = taxonomy[nn]; | ||
if (tax == null) break; | ||
let b = tax["c"] | ||
let tmp: React.JSX.Element[] = [] | ||
tmp.push(<div key="rank" className={styles.rank}> | ||
{r} | ||
</div>) | ||
for (let t of b) { | ||
tmp.push(<div key={n} className={`${t == n && styles.highlight}`}> | ||
{t} | ||
</div>) | ||
} | ||
n = nn | ||
r = tax["r"] | ||
lst.push(tmp) | ||
if (r != "CLADE") | ||
bread.push(n) | ||
|
||
} | ||
lst.push([<div key={n} className={styles.highlight}>{n}</div>]) | ||
bread.reverse() | ||
return <div className={styles.atxlst}> | ||
<nav aria-label="breadcrumb"> | ||
<ol className="breadcrumb"> | ||
{bread.map((b, i) => { | ||
return <li className="breadcrumb-item" key={i}>{b}</li> | ||
})} | ||
</ol> | ||
</nav> | ||
<div className='row flex-nowrap overflow-x-auto flex-row-reverse'> | ||
{lst.map((t, i) => <div key={i} className="col">{t.map((item) => item)}</div>)} | ||
</div> | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,12 @@ | ||
'use client'; | ||
import React, {useEffect, useState} from 'react' | ||
|
||
import React from 'react' | ||
import Taxonomy_list from "../components/taxonomy_list"; | ||
|
||
|
||
function Display() { | ||
|
||
const [prevSearchQuery, setPrevSearchQuery] = useState(""); | ||
|
||
useEffect(() => { | ||
const searchQuery = localStorage.getItem('lastSearchQuery'); | ||
|
||
if (searchQuery !== null) { | ||
console.log('Your search: ', searchQuery); | ||
setPrevSearchQuery(searchQuery); | ||
|
||
localStorage.removeItem('lastSearchQuery'); | ||
} | ||
else { | ||
console.log("no data"); | ||
} | ||
}, []) | ||
|
||
|
||
return ( | ||
prevSearchQuery && <div>your search is: {prevSearchQuery}</div> | ||
) | ||
return <Taxonomy_list family="Asteraceae"/> | ||
} | ||
|
||
export default Display; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.