hide & disable video functionality on prod

This commit is contained in:
Abi Raja 2024-03-19 13:12:41 -04:00
parent 785a135460
commit b6222ddbc9
2 changed files with 26 additions and 17 deletions

View File

@ -261,6 +261,9 @@ async def stream_code(websocket: WebSocket):
else: else:
try: try:
if validated_input_mode == "video": if validated_input_mode == "video":
if IS_PROD:
raise Exception("Video mode is not supported in prod")
if not ANTHROPIC_API_KEY: if not ANTHROPIC_API_KEY:
await throw_error( await throw_error(
"No Anthropic API key found. Please add the environment variable ANTHROPIC_API_KEY to backend/.env" "No Anthropic API key found. Please add the environment variable ANTHROPIC_API_KEY to backend/.env"

View File

@ -7,6 +7,7 @@ import { URLS } from "../urls";
import { Badge } from "./ui/badge"; import { Badge } from "./ui/badge";
import ScreenRecorder from "./recording/ScreenRecorder"; import ScreenRecorder from "./recording/ScreenRecorder";
import { ScreenRecorderState } from "../types"; import { ScreenRecorderState } from "../types";
import { IS_RUNNING_ON_CLOUD } from "../config";
const baseStyle = { const baseStyle = {
flex: 1, flex: 1,
@ -173,24 +174,29 @@ function ImageUpload({ setReferenceImages }: Props) {
</p> </p>
</div> </div>
)} )}
{screenRecorderState === ScreenRecorderState.INITIAL && ( {/* Disable on prod for now */}
<div className="text-center text-sm text-slate-800 mt-4"> {!IS_RUNNING_ON_CLOUD && (
<Badge>New!</Badge> Upload a screen recording (.mp4, .mov) or record <>
your screen to clone a whole app (experimental).{" "} {screenRecorderState === ScreenRecorderState.INITIAL && (
<a <div className="text-center text-sm text-slate-800 mt-4">
className="underline" <Badge>New!</Badge> Upload a screen recording (.mp4, .mov) or
href={URLS["intro-to-video"]} record your screen to clone a whole app (experimental).{" "}
target="_blank" <a
> className="underline"
Learn more. href={URLS["intro-to-video"]}
</a> target="_blank"
</div> >
Learn more.
</a>
</div>
)}
<ScreenRecorder
screenRecorderState={screenRecorderState}
setScreenRecorderState={setScreenRecorderState}
generateCode={setReferenceImages}
/>
</>
)} )}
<ScreenRecorder
screenRecorderState={screenRecorderState}
setScreenRecorderState={setScreenRecorderState}
generateCode={setReferenceImages}
/>
</section> </section>
); );
} }