import { Component, createRef } from "preact"; import { AdvancedFoodItem, FoodItem, FoodItemsContainer } from "./foodItems"; import { FoodTypeToggles } from "./foodTypeToggles"; import { FoodExcludeTypes } from "./types"; const FONT_TYPES = [ ["default", "Default (Comic Sans, Comic Neue or Default)"], ["system", "System Sans Font (as picked by Bootstrap Defaults)"], ["comicneue", "Comic Neue"], ["opendyslexic", "Open Dyslexic"] ]; export class SettingsBlock extends Component { constructor() { super() } fontSettingSelectRef = createRef() componentDidMount() { document.body.setAttribute("data-font", "default"); } onFontChange() { if (!this.fontSettingSelectRef.current) return; let newFont = this.fontSettingSelectRef.current.value; for (let font of FONT_TYPES) { document.body.removeAttribute(`data-font-${font[1]}`) } document.body.setAttribute("data-font", newFont); } render() { return

Settings

} } export class MainPage extends Component { constructor() { super() } render() { return <>

Chaos's Food Likes/Dislikes

a hopefully helpful guide on what food i like?



{ this.setState({ toggles }); }} />










; } }