From 1c07fe9dc1afee09aedc3790299ad34fc8e8757c Mon Sep 17 00:00:00 2001 From: lifegpc Date: Mon, 29 May 2023 16:53:19 +0800 Subject: [PATCH] Format files --- islands/Container.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/islands/Container.tsx b/islands/Container.tsx index 586e0f4..f3c2e69 100644 --- a/islands/Container.tsx +++ b/islands/Container.tsx @@ -1,6 +1,6 @@ import { Head } from "$fresh/runtime.ts"; import { Component, ContextType } from "preact"; -import { useState, StateUpdater, useEffect } from "preact/hooks"; +import { StateUpdater, useEffect, useState } from "preact/hooks"; import Icon from "preact-material-components/Icon"; import List from "preact-material-components/List"; import TopAppBar from "preact-material-components/TopAppBar"; @@ -24,7 +24,7 @@ export default class Container extends Component { const v = typeof updater === "function" ? updater(state) : updater; set_state1(v); history.pushState(v, "", v); - } + }; useEffect(() => { const hash = document.location.hash; if (!hash || hash == "#") { @@ -32,15 +32,15 @@ export default class Container extends Component { } else { set_state1(hash); } - self.addEventListener('popstate', (e) => { + self.addEventListener("popstate", (e) => { const s = e.state; if (typeof s === "string") { set_state1(s); } else { set_state1("#/"); } - }) - }, []) + }); + }, []); return (
@@ -68,10 +68,12 @@ export default class Container extends Component { set_display(false)}> close - { - set_display(false); - set_state("#/"); - }}> + { + set_display(false); + set_state("#/"); + }} + > home