This file contains hidden or 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
| import { useFusionAuth } from "@fusionauth/react-sdk"; | |
| import { useEffect } from "react"; | |
| import { useNavigate } from "react-router-dom"; | |
| export default function AccountPage() { | |
| const navigate = useNavigate(); | |
| const { isLoggedIn, isFetchingUserInfo } = useFusionAuth(); |
This file contains hidden or 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
| import { useNavigate } from "react-router-dom"; | |
| import { useFusionAuth } from "@fusionauth/react-sdk"; | |
| import { useEffect } from "react"; | |
| export default function HomePage() { | |
| const navigate = useNavigate(); | |
| const { isLoggedIn, isFetchingUserInfo, startLogin, startRegister } = | |
| useFusionAuth(); |
This file contains hidden or 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
| import { Navigate, Route, Routes } from "react-router-dom"; | |
| import HomePage from "./pages/HomePage"; | |
| import AccountPage from "./pages/AccountPage"; | |
| import { useFusionAuth } from "@fusionauth/react-sdk"; | |
| function App() { | |
| const { isFetchingUserInfo } = useFusionAuth(); |
This file contains hidden or 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
| --- | |
| layout: "base.html" | |
| title: Search Page | |
| permalink: | |
| search: /search/ | |
| --- | |
| <h2>{{ eleventy.serverless.query.query }}</h2> | |
| {% assign results = eleventy.serverless.query.query | getResults %} | |
| {% for result in results %} |
This file contains hidden or 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
| templates: { | |
| item({ item }) { | |
| return <Action hit={item} />; | |
| } | |
| } |
This file contains hidden or 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
| function Action({ hit }) { | |
| // Component to display the items | |
| return ( | |
| <div className="aa-ItemWrapper"> | |
| <div className="aa-ItemContent"> | |
| <div className="aa-ItemIcon">{hit.icon}</div> | |
| <div className="aa-ItemContentBody"> | |
| <div className="aa-ItemContentTitle"> | |
| <span>{hit.highlighted}</span> | |
| {hit.enabled && ( |
This file contains hidden or 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
| onSelect({ setContext }) { | |
| document.querySelector("body").classList.remove("dark"); | |
| setContext({ dark: false }); | |
| } |
This file contains hidden or 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
| { //... | |
| label: "/dark", | |
| enabled: state.context.dark, | |
| // ... | |
| }, | |
| { //... | |
| label: "/light", | |
| enabled: !state.context.dark, | |
| // ... | |
| } |
This file contains hidden or 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
| return [ | |
| { | |
| icon: ( | |
| <svg fill="none" viewBox="0 0 24 24" stroke="currentColor"> | |
| <path | |
| strokeLinecap="round" | |
| strokeLinejoin="round" | |
| strokeWidth={2} | |
| d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" | |
| /> |
This file contains hidden or 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
| function Action({ hit }) { | |
| // Component to display the items | |
| return ( | |
| <div className="aa-ItemWrapper"> | |
| <div className="aa-ItemContent"> | |
| <div className="aa-ItemIcon">{hit.icon}</div> | |
| <div className="aa-ItemContentBody"> | |
| <div className="aa-ItemContentTitle"> | |
| <span>{hit.highlighted}</span> | |
| </div> |
NewerOlder