-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add: deeplinks * add: enhanced pagination for large datasets * add more meta tags * add data to initial state * remove preview page, instead link directly into the list
- Loading branch information
Showing
35 changed files
with
504 additions
and
624 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {NixFunctions as default} from "./nixFunctions"; |
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,56 @@ | ||
import { Box } from "@mui/system"; | ||
import { useMemo } from "react"; | ||
import { PageState } from "../../models/internals"; | ||
import { byQuery, byType, pipe } from "../../queries"; | ||
import { DocItem } from "../../models/nix"; | ||
import { BasicList, BasicListItem } from "../basicList"; | ||
import FunctionItem from "../functionItem/functionItem"; | ||
import { SetPageStateVariable } from "../pageContext"; | ||
|
||
interface FunctionsProps { | ||
pageState: PageState; | ||
setPageStateVariable: SetPageStateVariable; | ||
} | ||
|
||
export function NixFunctions(props: FunctionsProps) { | ||
const { pageState, setPageStateVariable } = props; | ||
const { data, selected, term, filter } = pageState; | ||
|
||
const setSelected = setPageStateVariable<string | null>("selected"); | ||
|
||
const filteredData = useMemo( | ||
() => pipe(byType(filter), byQuery(term))(data), | ||
[filter, term, data] | ||
); | ||
|
||
const preRenderedItems: BasicListItem[] = filteredData.map( | ||
(docItem: DocItem) => { | ||
const key = docItem.id; | ||
return { | ||
item: ( | ||
<Box | ||
sx={{ | ||
width: "100%", | ||
height: "100%", | ||
}} | ||
onClick={!(selected === key) ? () => setSelected(key) : undefined} | ||
> | ||
<FunctionItem | ||
name={docItem.name} | ||
docItem={docItem} | ||
selected={selected === key} | ||
handleClose={() => setSelected(null)} | ||
/> | ||
</Box> | ||
), | ||
key, | ||
}; | ||
} | ||
); | ||
|
||
return ( | ||
<Box sx={{ ml: { xs: 0, md: 2 } }}> | ||
<BasicList items={preRenderedItems} /> | ||
</Box> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
|
||
.hljs { | ||
padding-left: 0 !important; | ||
padding-top: 0 !important; | ||
} | ||
.hljs .pre { | ||
width: 100%; | ||
} | ||
.hljs .nix { | ||
overflow-x: scroll; | ||
} |
Oops, something went wrong.
8679af3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
noogle – ./
noogle-gold.vercel.app
noogle-git-main-hsjobeki.vercel.app
noogle-hsjobeki.vercel.app