mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
My last commit while I am still 35
This commit is contained in:
@@ -13,6 +13,7 @@ export const DomainContext = createContext<DomainContextType>({
|
||||
},
|
||||
api_url: "",
|
||||
websocket_url: "",
|
||||
zulip_streams: "",
|
||||
});
|
||||
|
||||
export const DomainContextProvider = ({
|
||||
@@ -42,7 +43,7 @@ export const featureEnabled = (
|
||||
featureName: "requireLogin" | "privacy" | "browse" | "sendToZulip",
|
||||
) => {
|
||||
const context = useContext(DomainContext);
|
||||
console.log(context.features, featureName);
|
||||
|
||||
return context.features[featureName] as boolean | undefined;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import React, { useContext, useState, useEffect } from "react";
|
||||
import SelectSearch from "react-select-search";
|
||||
import { getZulipMessage, sendZulipMessage } from "../../../lib/zulip";
|
||||
import { GetTranscript, GetTranscriptTopic } from "../../../api";
|
||||
import "react-select-search/style.css";
|
||||
import { DomainContext } from "../../domainContext";
|
||||
|
||||
type ShareModal = {
|
||||
show: boolean;
|
||||
@@ -28,9 +29,10 @@ const ShareModal = (props: ShareModal) => {
|
||||
const [includeTopics, setIncludeTopics] = useState(false);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [streams, setStreams] = useState<Stream[]>([]);
|
||||
const { zulip_streams } = useContext(DomainContext);
|
||||
|
||||
useEffect(() => {
|
||||
fetch(process.env.NEXT_PUBLIC_ZULIIPSTREAMS_HOSTNAME + "/streams.json")
|
||||
fetch(zulip_streams + "/streams.json")
|
||||
.then((response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error("Network response was not ok");
|
||||
|
||||
@@ -3,14 +3,15 @@ import { isDevelopment } from "./utils";
|
||||
|
||||
const localConfig = {
|
||||
features: {
|
||||
requireLogin: true,
|
||||
requireLogin: false,
|
||||
privacy: true,
|
||||
browse: true,
|
||||
sendToZulip: false,
|
||||
browse: false,
|
||||
sendToZulip: true,
|
||||
},
|
||||
api_url: "http://127.0.0.1:1250",
|
||||
websocket_url: "ws://127.0.0.1:1250",
|
||||
auth_callback_url: "http://localhost:3000/auth-callback",
|
||||
zulip_streams: "https://d3ow1y42gqfmk.cloudfront.net",
|
||||
};
|
||||
|
||||
type EdgeConfig = {
|
||||
@@ -25,6 +26,7 @@ type EdgeConfig = {
|
||||
auth_callback_url: string;
|
||||
websocket_url: string;
|
||||
api_url: string;
|
||||
zulip_streams: string;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user