Add posts and old grade-calc
Fix small bugs >bad commit
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ChangeEvent, useCallback, useEffect, useRef, useState } from 'react';
|
||||
import Fuzzy from './_fuzzy';
|
||||
import pages from '../public/pages.json';
|
||||
import posts from '../public/posts.json';
|
||||
import style from '../styles/fuzzy.module.css';
|
||||
|
||||
function FuzzyBar(): JSX.Element {
|
||||
@@ -13,9 +14,15 @@ function FuzzyBar(): JSX.Element {
|
||||
|
||||
let fuzz: Fuzzy | null = null;
|
||||
|
||||
let entries = [...pages];
|
||||
|
||||
for (const [k,v] of posts.entries()) {
|
||||
entries.push({title: v.title, link: `posts/${v.slug}`});
|
||||
}
|
||||
|
||||
try {
|
||||
fuzz = new Fuzzy({
|
||||
pages: pages,
|
||||
pages: entries,
|
||||
searchField: searchField,
|
||||
searchValue: searchValue,
|
||||
resultsValue: resultsValue,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import FuzzyBar from './fuzzy-bar';
|
||||
import Logo from '../public/logo.svg';
|
||||
import Meta from './meta';
|
||||
import Title from './title';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import style from '../styles/title.module.css';
|
||||
import Link from 'next/link';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
type propsObj = {
|
||||
name: string,
|
||||
|
||||
Reference in New Issue
Block a user