diff --git a/vocodes/src/v2/NewVocodesContainer.tsx b/vocodes/src/v2/NewVocodesContainer.tsx index 7522ca8534..4891502389 100644 --- a/vocodes/src/v2/NewVocodesContainer.tsx +++ b/vocodes/src/v2/NewVocodesContainer.tsx @@ -11,7 +11,7 @@ import { ProfileEditFc } from './profile/profile_edit/ProfileEditFc'; import { ProfileFc } from './profile/profile_view/ProfileFc'; import { SessionWrapper } from '../session/SessionWrapper'; import { SignupComponent } from './signup/SignupComponent'; -import { Switch, Route, RouteProps } from 'react-router-dom'; +import { Switch, Route } from 'react-router-dom'; import { TermsFc } from './about/terms_page/TermsFc'; import { TtsInferenceJob, W2lInferenceJob } from '../App'; import { TtsModelDeleteFc } from './tts/tts_model_delete/TtsModelDeleteFc'; @@ -88,21 +88,17 @@ class NewVocodesContainer extends React.Component { - ( + - )} - /> + - ( + - )} - /> + (""); const [cashApp, setCashApp] = useState(""); const [websiteUrl, setWebsiteUrl] = useState(""); + const [preferredTtsResultVisibility, setPreferredTtsResultVisibility] = useState(DEFAULT_VISIBILITY); + const [preferredW2lResultVisibility, setPreferredW2lResultVisibility] = useState(DEFAULT_VISIBILITY); useEffect(() => { const api = new ApiConfig(); @@ -86,6 +91,9 @@ function ProfileEditFc(props: Props) { //setPatreon(profileResponse.user?.patreon_username || ""); setGithub(profileResponse.user?.github_username || ""); setWebsiteUrl(profileResponse.user?.website_url || ""); + + setPreferredTtsResultVisibility(profileResponse.user?.preferred_tts_result_visibility || DEFAULT_VISIBILITY); + setPreferredW2lResultVisibility(profileResponse.user?.preferred_w2l_result_visibility || DEFAULT_VISIBILITY); }) .catch(e => { //this.props.onSpeakErrorCallback(); @@ -125,6 +133,14 @@ function ProfileEditFc(props: Props) { setWebsiteUrl((ev.target as HTMLInputElement).value) }; + const handlePreferredTtsResultVisibilityChange = (ev: React.FormEvent) => { + setPreferredTtsResultVisibility((ev.target as HTMLSelectElement).value) + }; + + const handlePreferredW2lResultVisibilityChange = (ev: React.FormEvent) => { + setPreferredW2lResultVisibility((ev.target as HTMLSelectElement).value) + }; + const handleFormSubmit = (ev: React.FormEvent) : boolean => { ev.preventDefault(); @@ -140,6 +156,8 @@ function ProfileEditFc(props: Props) { github_username: github, //patreon_username: patreon, website_url: websiteUrl, + preferred_tts_result_visibility: preferredTtsResultVisibility, + preferred_w2l_result_visibility: preferredW2lResultVisibility, } fetch(endpointUrl, { @@ -170,28 +188,65 @@ function ProfileEditFc(props: Props) { return (
-

Editing Profile: {username}

+

Profile & Preferences

- < Back to profile + < Back to profile

-
- -

- Profiles help you network with other creatives. -

-

- We're going to make amazing and hilarious content together! -

-
-
+ +

Preferences

+ +
+

+ Control how the site functions. +

+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +

Profile

+ +
+

+ Profiles help you network with other creatives. + We're going to make amazing and hilarious content together! +

+
+
- +