-
Notifications
You must be signed in to change notification settings - Fork 0
feat: adding search #828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: adding search #828
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |||||
| "version": "0.1.0", | ||||||
| "author": "Kayla Altepeter", | ||||||
| "engines": { | ||||||
| "node": ">=18.16.1", | ||||||
| "node": ">=24.15.0", | ||||||
|
||||||
| "node": ">=24.15.0", | |
| "node": ">=18.16.1", |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| import { Chip, ListItem, ListItemText, Typography } from "@mui/material"; | ||
| import { styled } from "@mui/material/styles"; | ||
| import { Link } from "gatsby"; | ||
| import React from "react"; | ||
| import { Note } from "../models/note"; | ||
|
|
||
| const NoteItemContainer = styled(ListItem)({ | ||
| "& .head": { | ||
| display: "flex", | ||
| justifyContent: "space-between", | ||
| alignItems: "baseline", | ||
| }, | ||
| }); | ||
|
|
||
| const TagList = styled("ul")(({ theme }) => ({ | ||
| display: "flex", | ||
| justifyContent: "left", | ||
| flexWrap: "wrap", | ||
| listStyle: "none", | ||
| padding: theme.spacing(0.5), | ||
| margin: 0, | ||
| })); | ||
|
|
||
| const TagChip = styled((props: React.ComponentProps<typeof Chip>) => ( | ||
| <Chip component="span" {...props} /> | ||
| ))({ | ||
| border: "none", | ||
| borderRadius: 0, | ||
| }); | ||
|
|
||
| type NoteListEntryProps = { | ||
| note: Note; | ||
| titleComponent?: "h2" | "h3"; | ||
| }; | ||
|
|
||
| const NoteListEntry: React.FC<NoteListEntryProps> = ({ | ||
| note, | ||
| titleComponent = "h3", | ||
| }) => ( | ||
| <NoteItemContainer divider> | ||
| <ListItemText | ||
| inset={false} | ||
| slotProps={{ | ||
| primary: { className: "head" }, | ||
| secondary: { component: "div" }, | ||
| }} | ||
| primary={ | ||
| <> | ||
| <Typography component={titleComponent} variant="h6"> | ||
| <Link to={note.fields.slug}> | ||
| {note.frontmatter.title} | ||
| </Link> | ||
| </Typography> | ||
| <Typography variant="overline">{note.frontmatter.date}</Typography> | ||
| </> | ||
| } | ||
| secondary={ | ||
| <> | ||
| <TagList> | ||
| {note.frontmatter.tags?.map((tag) => ( | ||
| <Typography component="li" variant="subtitle1" key={tag}> | ||
| <TagChip | ||
| size="medium" | ||
| variant="outlined" | ||
| color="secondary" | ||
| label={`#${tag}`} | ||
| /> | ||
| </Typography> | ||
| ))} | ||
| </TagList> | ||
| <Typography component="p" variant="body1" color="text.primary"> | ||
| {note.excerpt} | ||
| </Typography> | ||
| </> | ||
| } | ||
| /> | ||
| </NoteItemContainer> | ||
| ); | ||
|
|
||
| export default NoteListEntry; |
Uh oh!
There was an error while loading. Please reload this page.