-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fea0b29
commit d0a0bb8
Showing
5 changed files
with
57 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
export type serverSettingsType = {}; | ||
export type serverSettingsType = { | ||
customSearch: { | ||
name: string; | ||
url: string; //検索キーワードが%sに入る | ||
}[]; | ||
}; | ||
export type localSettings = {}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"use client"; | ||
|
||
import { customSession } from "@/@types/customSession"; | ||
import { localSettings } from "@/@types/settings"; | ||
import { useSession } from "next-auth/react"; | ||
import { atom, useRecoilState } from "recoil"; | ||
import { recoilPersist } from "recoil-persist"; | ||
import { useServerSettings } from "../_library/settings/useServerSettings"; | ||
|
||
export default function Settings() { | ||
const { data: session }: { data: customSession | null } = | ||
useSession() as unknown as { data: customSession }; | ||
const token = session?.accessToken; | ||
const { serverSettings, setServerSettings, isLoading, isSaving } = | ||
useServerSettings(token); | ||
if (isLoading) return <p className="text-center">loading...</p>; | ||
return <div></div>; | ||
} | ||
// recoil | ||
const { persistAtom } = recoilPersist({ | ||
key: "settings", | ||
storage: typeof window === "undefined" ? undefined : localStorage, | ||
}); | ||
export const localSettingsState = atom<localSettings>({ | ||
key: "settings", | ||
default: {}, | ||
effects_UNSTABLE: [persistAtom], | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Metadata } from "next"; | ||
import Settings from "./main"; | ||
|
||
export default function Page() { | ||
return <Settings />; | ||
} | ||
export const metadata: Metadata = { | ||
title: "設定", | ||
description: "VocabPhraseの設定ページです。", | ||
robots: "noindex", | ||
}; |
This file was deleted.
Oops, something went wrong.