+ {!authenticated &&
}
+
+
+
+
-
-
-
- {props.children}
-
-
+
-
- {props.RightSidebar ? props.RightSidebar : (
- <>
-
-
-
-
-
-
- >
- )}
-
+
+ {props.RightSidebar ? (
+ props.RightSidebar
+ ) : (
+ <>
+
+
+
+
+
+
+ >
+ )}
- )
-}
+ );
+};
-export default ThreeColumnLayout
+export default ThreeColumnLayout;
diff --git a/pages/_app.tsx b/pages/_app.tsx
index 21457ad..d94096f 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -1,31 +1,32 @@
/* eslint-disable react/jsx-props-no-spreading */
-import type { AppProps } from 'next/app';
-import Head from 'next/head';
-import Script from 'next/script';
-import { SensiletProvider } from '../context/SensiletContext'
+import type { AppProps } from "next/app";
+import Head from "next/head";
+import Script from "next/script";
+import { SensiletProvider } from "../context/SensiletContext";
-import { GetServerSideProps } from 'next'
+import { GetServerSideProps } from "next";
-import '../styles/globals.css';
-import { ThemeProvider } from 'next-themes';
-import { Toaster } from 'react-hot-toast';
-import { init } from '@socialgouv/matomo-next';
-import { useEffect } from 'react';
-import { config } from '../template_config';
-import { RelayProvider } from '../context/RelayContext';
-import { HandCashProvider } from '../context/HandCashContext';
-import { TuneProvider } from '../context/TuningContext';
-import Locales from '../context/LocalContext';
-import { BitcoinProvider } from '../context/BitcoinContext';
-import { TwetchProvider } from '../context/TwetchContext';
-import { LocalWalletProvider } from '../context/LocalWalletContext';
-import 'react-tooltip/dist/react-tooltip.css';
+import "../styles/globals.css";
+import { ThemeProvider } from "next-themes";
+import { Toaster } from "react-hot-toast";
+import { init } from "@socialgouv/matomo-next";
+import { useEffect } from "react";
+import { config } from "../template_config";
+import { RelayProvider } from "../context/RelayContext";
+import { HandCashProvider } from "../context/HandCashContext";
+import { TuneProvider } from "../context/TuningContext";
+import Locales from "../context/LocalContext";
+import { BitcoinProvider } from "../context/BitcoinContext";
+import { TwetchProvider } from "../context/TwetchContext";
+import { LocalWalletProvider } from "../context/LocalWalletContext";
+import { ColorSchemeProvider } from "../v13_context/ColorSchemeContext";
+import "react-tooltip/dist/react-tooltip.css";
-import { useSubdomain } from '../hooks/subdomain'
+import { useSubdomain } from "../hooks/subdomain";
export default function App({ Component, pageProps }: AppProps) {
//const { openGraphData = [] } = pageProps;
- const { subdomain } = useSubdomain()
+ const { subdomain } = useSubdomain();
const openGraphData = [
{
@@ -70,7 +71,7 @@ export default function App({ Component, pageProps }: AppProps) {
content: "website",
key: "website",
},
- ]
+ ];
useEffect(() => {
const MATOMO_URL = String(process.env.NEXT_PUBLIC_MATOMO_URL);
@@ -92,30 +93,32 @@ export default function App({ Component, pageProps }: AppProps) {
src="https://one.relayx.io/relayone.js"
strategy="beforeInteractive"
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
>
);
}
diff --git a/pages/settings.tsx b/pages/settings.tsx
index e353cd5..18ac793 100644
--- a/pages/settings.tsx
+++ b/pages/settings.tsx
@@ -8,6 +8,7 @@ import { useRelay } from "../context/RelayContext";
import { useSensilet } from "../context/SensiletContext";
import { useHandCash } from "../context/HandCashContext";
import { useTwetch } from "../context/TwetchContext";
+
import useWallet from "../hooks/useWallet";
import TuningPanel from "../components/TuningPanel";
@@ -18,12 +19,13 @@ import { useLocalWallet } from "../context/LocalWalletContext";
import WalletSelect from "../components/WalletSelect";
import { useTuning } from "../context/TuningContext";
+import ColorSchemeSelector from "../components/ColorSchemeSelector";
+
function capitalizeFirstLetter(s: string) {
- return s.charAt(0).toUpperCase() + s.slice(1);
-
+ return s.charAt(0).toUpperCase() + s.slice(1);
}
const ConnectedWallet = () => {
- const { wallet } = useBitcoin()
+ const { wallet } = useBitcoin();
switch (wallet) {
case "relayx":
return (
@@ -66,7 +68,7 @@ const ConnectedWallet = () => {
/>
- )
+ );
case "twetch":
return (
@@ -99,11 +101,14 @@ const ConnectedWallet = () => {
/>
- )
+ );
case "handcash":
return (
-
+
Handcash
- )
+ );
case "sensilet":
return (
-
+
Sensilet
-
+
- )
+ );
case "local":
return (
-
- )
+ );
default:
- return <>>
+ return <>>;
}
-}
+};
export default function Settings() {
const { theme, setTheme } = useTheme();
- const { logout, authenticated, setWallet, setWalletPopupOpen, walletPopupOpen } = useBitcoin();
+ const {
+ logout,
+ authenticated,
+ setWallet,
+ setWalletPopupOpen,
+ walletPopupOpen,
+ } = useBitcoin();
const { signPosts, setSignPosts } = useTuning();
- const { web3, web3Account, sensiletLogout, sensiletAuthenticate, sensiletAuthenticated } = useSensilet()
+ const {
+ web3,
+ web3Account,
+ sensiletLogout,
+ sensiletAuthenticate,
+ sensiletAuthenticated,
+ } = useSensilet();
const [isDark, setIsDark] = useState(theme === "dark");
- const [sensiletChecked, setSensiletChecked] = useState(!!web3Account)
-
- const { handcashAuthenticated, handcashAuthenticate, handcashPaymail, handcashLogout } = useHandCash()
- const { relayxWallet, relayxLogout, relayxAuthenticated } = useRelay()
- const { localWalletLogout, localWallet, localWalletAuthenticated } = useLocalWallet()
- const { twetchWallet, twetchLogout, twetchAuthenticated } = useTwetch()
+ const [sensiletChecked, setSensiletChecked] = useState(!!web3Account);
+
+ const {
+ handcashAuthenticated,
+ handcashAuthenticate,
+ handcashPaymail,
+ handcashLogout,
+ } = useHandCash();
+ const { relayxWallet, relayxLogout, relayxAuthenticated } = useRelay();
+ const { localWalletLogout, localWallet, localWalletAuthenticated } =
+ useLocalWallet();
+ const { twetchWallet, twetchLogout, twetchAuthenticated } = useTwetch();
const walletConnected = useMemo(() => {
- const wallets = [relayxAuthenticated, twetchAuthenticated, handcashAuthenticated, sensiletAuthenticated, localWalletAuthenticated];
- return wallets.filter(wallet => wallet).length;
- },[relayxAuthenticated, twetchAuthenticated, handcashAuthenticated, sensiletAuthenticated, localWalletAuthenticated])
- const wallet = useWallet()
+ const wallets = [
+ relayxAuthenticated,
+ twetchAuthenticated,
+ handcashAuthenticated,
+ sensiletAuthenticated,
+ localWalletAuthenticated,
+ ];
+ return wallets.filter((wallet) => wallet).length;
+ }, [
+ relayxAuthenticated,
+ twetchAuthenticated,
+ handcashAuthenticated,
+ sensiletAuthenticated,
+ localWalletAuthenticated,
+ ]);
+ const wallet = useWallet();
useEffect(() => {
if (theme === "dark") {
@@ -203,16 +248,12 @@ export default function Settings() {
}, [theme]);
async function connectSensilet() {
-
- sensiletAuthenticate()
-
+ sensiletAuthenticate();
}
useEffect(() => {
-
- setSensiletChecked(!!web3Account)
-
- }, [web3Account])
+ setSensiletChecked(!!web3Account);
+ }, [web3Account]);
const toggleTheme = () => {
if (theme === "dark") {
@@ -223,53 +264,43 @@ export default function Settings() {
}
};
- const handleHandcashLogin = (e:any) => {
+ const handleHandcashLogin = (e: any) => {
e.preventDefault();
- setWallet("handcash")
- handcashAuthenticate()
- }
-
- function handleLogout(walletName: string) {
-
- switch(walletName) {
-
- case 'relayx':
-
- relayxLogout()
-
- break;
-
- case 'handcash':
-
- handcashLogout()
-
- break;
+ setWallet("handcash");
+ handcashAuthenticate();
+ };
- case 'twetch':
+ function handleLogout(walletName: string) {
+ switch (walletName) {
+ case "relayx":
+ relayxLogout();
- twetchLogout()
+ break;
- break;
+ case "handcash":
+ handcashLogout();
- case 'local':
+ break;
- localWalletLogout()
+ case "twetch":
+ twetchLogout();
- break;
+ break;
- case 'sensilet':
+ case "local":
+ localWalletLogout();
- sensiletLogout()
+ break;
- break;
+ case "sensilet":
+ sensiletLogout();
+ break;
}
if (wallet?.name === walletName) {
-
- setWallet(null)
+ setWallet(null);
}
-
}
return (
@@ -330,8 +361,16 @@ export default function Settings() {
checked={isDark}
onChange={toggleTheme}
/>
-
-
+
+