chore: update prettier setting

This commit is contained in:
zerosoul
2022-06-12 15:30:14 +08:00
parent 14b4678d9e
commit 516794d352
209 changed files with 2435 additions and 4588 deletions
+2 -9
View File
@@ -7,14 +7,7 @@ import Toggle from "../../../common/component/styled/Toggle";
import SaveTip from "../../../common/component/SaveTip";
import useConfig from "../../../common/hook/useConfig";
export default function ConfigAgora() {
const {
changed,
reset,
values,
setValues,
toggleEnable,
updateConfig,
} = useConfig("agora");
const { changed, reset, values, setValues, toggleEnable, updateConfig } = useConfig("agora");
const handleUpdate = () => {
// const { token_url, description } = values;
updateConfig(values);
@@ -34,7 +27,7 @@ export default function ConfigAgora() {
app_certificate,
rtm_key,
rtm_secret,
enabled = false,
enabled = false
} = values ?? {};
return (
<StyledContainer>
+2 -10
View File
@@ -8,14 +8,7 @@ import SaveTip from "../../../common/component/SaveTip";
import useConfig from "../../../common/hook/useConfig";
export default function ConfigFirebase() {
const {
values,
toggleEnable,
updateConfig,
setValues,
reset,
changed,
} = useConfig("firebase");
const { values, toggleEnable, updateConfig, setValues, reset, changed } = useConfig("firebase");
const handleUpdate = () => {
// const { token_url, description } = values;
updateConfig(values);
@@ -28,8 +21,7 @@ export default function ConfigFirebase() {
});
};
// if (!values) return null;
const { token_url, project_id, private_key, client_email, enabled = false } =
values ?? {};
const { token_url, project_id, private_key, client_email, enabled = false } = values ?? {};
return (
<StyledContainer>
<div className="inputs">
+6 -13
View File
@@ -15,17 +15,15 @@ export default function Logins() {
changed: clientIdChanged,
clientId,
updateClientId,
updateClientIdToServer,
updateClientIdToServer
} = useGoogleAuthConfig();
const {
config: githubAuthConfig,
changed: githubChanged,
updateGithubAuthConfigToServer,
updateGithubAuthConfig,
updateGithubAuthConfig
} = useGithubAuthConfig();
const { values, updateConfig, setValues, reset, changed } = useConfig(
"login"
);
const { values, updateConfig, setValues, reset, changed } = useConfig("login");
const handleUpdate = async () => {
const { google } = values;
if (changed) {
@@ -70,8 +68,7 @@ export default function Logins() {
});
};
if (!values) return null;
const { google, magic_link, github, metamask, password, oidc = [] } =
values ?? {};
const { google, magic_link, github, metamask, password, oidc = [] } = values ?? {};
const valuesChanged = clientIdChanged || changed || githubChanged;
return (
@@ -97,9 +94,7 @@ export default function Logins() {
<div className="txt">
<Label>Magic Link</Label>
</div>
<span className="desc">
Allows members login with Magic Link.
</span>
<span className="desc">Allows members login with Magic Link.</span>
</div>
<Toggle
onClick={handleToggle.bind(null, { magic_link: !magic_link })}
@@ -191,9 +186,7 @@ export default function Logins() {
</div>
</div>
</div>
{valuesChanged && (
<SaveTip saveHandler={handleUpdate} resetHandler={reset} />
)}
{valuesChanged && <SaveTip saveHandler={handleUpdate} resetHandler={reset} />}
</StyledContainer>
);
}
+3 -11
View File
@@ -20,14 +20,7 @@ import toast from "react-hot-toast";
export default function ConfigSMTP() {
const [testEmail, setTestEmail] = useState("");
const [sendTestEmail, { isSuccess, isError }] = useSendTestEmailMutation();
const {
reset,
updateConfig,
values,
setValues,
changed,
toggleEnable,
} = useConfig("smtp");
const { reset, updateConfig, values, setValues, changed, toggleEnable } = useConfig("smtp");
const handleUpdate = () => {
// const { token_url, description } = values;
@@ -49,7 +42,7 @@ export default function ConfigSMTP() {
sendTestEmail({
to: testEmail,
subject: "test title",
content: "test content",
content: "test content"
});
};
useEffect(() => {
@@ -62,8 +55,7 @@ export default function ConfigSMTP() {
}, [isSuccess, isError]);
// if (!values) return null;
const { host, port, from, username, password, enabled = false } =
values ?? {};
const { host, port, from, username, password, enabled = false } = values ?? {};
console.log("values", values);
return (
<StyledContainer>