Compare commits

..

No commits in common. "71bdb216020af48436779d51bf8092cf8dc2d8c1" and "ee31c38f32d57d5511a4439d130e23083ed9a64d" have entirely different histories.

4 changed files with 17 additions and 42 deletions

View file

@ -1,27 +0,0 @@
.SignIn {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 448px;
@media (max-width: 600px) {
& {
position: static;
height: 100vh;
width: 100%;
transform: none;
overflow: auto;
}
}
>.key-content {
height: 100%;
>form {
display: flex;
flex-flow: column;
gap: 16px;
}
}
}

View file

@ -18,7 +18,6 @@ import { createRestAPIClient } from "masto";
import { getOrRegisterApp } from "./stores"; import { getOrRegisterApp } from "./stores";
import { useSearchParams } from "@solidjs/router"; import { useSearchParams } from "@solidjs/router";
import { $settings } from "../settings/stores"; import { $settings } from "../settings/stores";
import "./SignIn.css";
type ErrorParams = { type ErrorParams = {
error: string; error: string;
@ -37,6 +36,13 @@ const SignIn: Component = () => {
const [targetSiteTitle, setTargetSiteTitle] = createSignal(""); const [targetSiteTitle, setTargetSiteTitle] = createSignal("");
useDocumentTitle("Sign In"); useDocumentTitle("Sign In");
css`
form {
display: flex;
flex-flow: column;
gap: 16px;
}
`;
const serverUrl = () => { const serverUrl = () => {
const url = rawServerUrl(); const url = rawServerUrl();
@ -115,19 +121,19 @@ const SignIn: Component = () => {
}; };
return ( return (
<main class="SignIn"> <div class={cards.layoutCentered}>
<Show when={params.error || params.errorDescription}> <Show when={params.error || params.errorDescription}>
<div class={cards.card} style={{ "margin-bottom": "20px" }}> <div class={cards.card} style={{ "margin-bottom": "20px" }}>
<p>Authorization is failed.</p> <p>Authorization is failed.</p>
<p>{params.errorDescription}</p> <p>{params.errorDescription}</p>
<p> <p>
Please try again later. If the problem persists, you can ask for Please try again later. If the problem persist, you can seek for
help from the server administrator. help from the server administrator.
</p> </p>
</div> </div>
</Show> </Show>
<div <div
class={`${cards.card} key-content`} class={/*once*/ cards.card}
aria-busy={currentState() !== "inactive" ? "true" : "false"} aria-busy={currentState() !== "inactive" ? "true" : "false"}
aria-describedby={ aria-describedby={
currentState() !== "inactive" ? progressId : undefined currentState() !== "inactive" ? progressId : undefined
@ -163,7 +169,7 @@ const SignIn: Component = () => {
</div> </div>
</form> </form>
</div> </div>
</main> </div>
); );
}; };

View file

@ -1,4 +1,5 @@
import { import {
Router,
type RouterProps, type RouterProps,
type StaticRouterProps, type StaticRouterProps,
createRouter, createRouter,
@ -15,6 +16,9 @@ import {
useContext, useContext,
onCleanup, onCleanup,
type Accessor, type Accessor,
children,
createSignal,
createRoot,
} from "solid-js"; } from "solid-js";
import { createStore, unwrap } from "solid-js/store"; import { createStore, unwrap } from "solid-js/store";
import "./StackedRouter.css"; import "./StackedRouter.css";
@ -574,11 +578,7 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
createRenderEffect(() => createRenderEffect(() =>
untrack(() => { untrack(() => {
if (stack.length === 0) { if (stack.length === 0) {
const parts = [window.location.pathname] as string[]; pushFrame(window.location.pathname, {
if (window.location.search) {
parts.push(window.location.search);
}
pushFrame(parts.join(""), {
replace: "all", replace: "all",
}); });
} }

View file

@ -163,7 +163,7 @@ const Settings: Component = () => {
}>, }>,
() => import(`./i18n/generic.json`), () => import(`./i18n/generic.json`),
); );
const { pop, push } = useNavigator(); const { pop } = useNavigator();
const settings$ = useStore($settings); const settings$ = useStore($settings);
const { needRefresh } = useServiceWorker(); const { needRefresh } = useServiceWorker();
const dateFnLocale = useDateFnLocale(); const dateFnLocale = useDateFnLocale();
@ -172,10 +172,6 @@ const Settings: Component = () => {
const doSignOut = (acct: Account) => { const doSignOut = (acct: Account) => {
signOut((a) => a.site === acct.site && a.accessToken === acct.accessToken); signOut((a) => a.site === acct.site && a.accessToken === acct.accessToken);
if (profiles().length == 0) {
push("/accounts/sign-in", { replace: "all" });
}
}; };
css` css`