({});
+ const [initialized, setInitialized] = useState(false);
+
+ useEffect(() => {
+ (async () => {
+ try {
+ await Promise.all([workspaceStore.fetchWorkspaceProfile(), workspaceStore.fetchWorkspaceSetting(), userStore.fetchCurrentUser()]);
+ } catch (error) {
+ // Do nothing.
+ }
+ setInitialized(true);
+ })();
+ }, []);
+
+ return (
+ setCommonContext({ ...commonContext, locale }),
+ setAppearance: (appearance: string) => setCommonContext({ ...commonContext, appearance }),
+ }}
+ >
+ {!initialized ? null : <>{children}>}
+
+ );
+};
+
+export const useCommonContext = () => {
+ return useContext(CommonContext);
+};
+
+export default CommonContextProvider;
diff --git a/frontend/web/src/main.tsx b/frontend/web/src/main.tsx
index af7fd12..7a836c2 100644
--- a/frontend/web/src/main.tsx
+++ b/frontend/web/src/main.tsx
@@ -5,6 +5,7 @@ import { RouterProvider } from "react-router-dom";
import "./css/index.css";
import "./css/joy-ui.css";
import "./i18n";
+import CommonContextProvider from "./layouts/CommonContextProvider";
import router from "./routers";
const container = document.getElementById("root");
@@ -12,7 +13,9 @@ const root = createRoot(container as HTMLElement);
root.render(
-
+
+
+
,
);
diff --git a/frontend/web/src/pages/SignUp.tsx b/frontend/web/src/pages/SignUp.tsx
index 9f673ac..745b9ad 100644
--- a/frontend/web/src/pages/SignUp.tsx
+++ b/frontend/web/src/pages/SignUp.tsx
@@ -113,12 +113,16 @@ const SignUp: React.FC = () => {
-
- {"Already has an account?"}
-
- {t("auth.sign-in")}
-
-
+ {!workspaceStore.profile.owner ? (
+ {t("auth.host-tip")}
+ ) : (
+
+ {"Already has an account?"}
+
+ {t("auth.sign-in")}
+
+
+ )}