aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/paths
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-10-10 07:12:20 -0300
committerSebastian <sebasjm@gmail.com>2023-10-10 07:12:36 -0300
commit4e11051d9fccdbdd40abaa630afc130eafef6602 (patch)
treec412fc4f97af11e13d4c682c014e2b680ef57fbf /packages/merchant-backoffice-ui/src/paths
parent57f8cd3853ea33555faca57eec289482fc80ee58 (diff)
downloadwallet-core-4e11051d9fccdbdd40abaa630afc130eafef6602.tar.xz
removing url from login
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths')
-rw-r--r--packages/merchant-backoffice-ui/src/paths/login/index.tsx104
1 files changed, 4 insertions, 100 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/login/index.tsx b/packages/merchant-backoffice-ui/src/paths/login/index.tsx
index e37ef4bef..1c98b7c9b 100644
--- a/packages/merchant-backoffice-ui/src/paths/login/index.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/login/index.tsx
@@ -36,7 +36,7 @@ function normalizeToken(r: string): AccessToken {
}
export function LoginPage({ onConfirm }: Props): VNode {
- const { url: backendURL, changeBackend, resetBackend } = useBackendContext();
+ const { url: backendURL } = useBackendContext();
const { admin, id } = useInstanceContext();
const { requestNewLoginToken } = useCredentialsChecker();
const [token, setToken] = useState("");
@@ -54,11 +54,7 @@ export function LoginPage({ onConfirm }: Props): VNode {
} else {
onConfirm(undefined);
}
- }, [backendURL, id, token])
-
- async function changeServer() {
- resetBackend()
- }
+ }, [id, token])
if (admin && id !== "default") {
//admin trying to access another instance
@@ -139,26 +135,7 @@ export function LoginPage({ onConfirm }: Props): VNode {
style={{ border: "1px solid", borderTop: 0, borderBottom: 0 }}
>
<i18n.Translate>Please enter your access token.</i18n.Translate>
- <div class="field is-horizontal">
- <div class="field-label is-normal">
- <label class="label">URL</label>
- </div>
- <div class="field-body">
- <div class="field">
- <p class="control is-expanded">
- <input
- class="input"
- type="text"
- placeholder="set new url"
- name="id"
- value={backendURL}
- disabled
- readOnly
- />
- </p>
- </div>
- </div>
- </div>
+
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">
@@ -194,10 +171,7 @@ export function LoginPage({ onConfirm }: Props): VNode {
borderTop: 0,
}}
>
- <AsyncButton onClick={changeServer}>
- <i18n.Translate>Change server</i18n.Translate>
- </AsyncButton>
-
+ <div />
<AsyncButton
type="is-info"
onClick={doLogin}
@@ -226,73 +200,3 @@ function AsyncButton({ onClick, disabled, type = "", children }: { type?: string
}
-export function ConnectionPage({ onConfirm }: { onConfirm: (s: string) => void }): VNode {
- const { url: backendURL } = useBackendContext()
-
- const [error, setError] = useState<string>();
- const [url, setURL] = useState(backendURL ?? "");
- const { i18n } = useTranslationContext();
-
- async function doConnect() {
- const withHttp = url.startsWith("http") ? url : "https://" + url
-
- onConfirm(withHttp)
- }
-
- return (
- <div class="columns is-centered" style={{ margin: "auto" }}>
- <div class="column is-two-thirds ">
- <div class="modal-card" style={{ width: "100%", margin: 0 }}>
- <header
- class="modal-card-head"
- style={{ border: "1px solid", borderBottom: 0 }}
- >
- <p class="modal-card-title">{i18n.str`Connect to backend`}</p>
- </header>
- <section
- class="modal-card-body"
- style={{ border: "1px solid", borderTop: 0, borderBottom: 0 }}
- >
- <i18n.Translate>Location of the backend server</i18n.Translate>
- <div class="field is-horizontal">
- <div class="field-label is-normal">
- <label class="label">URL</label>
- </div>
- <div class="field-body">
- <div class="field">
- <p class="control is-expanded">
- <input
- class="input"
- type="text"
- placeholder="set new url"
- name="id"
- value={url ?? ""}
- onKeyPress={(e) =>
- e.keyCode === 13
- ? doConnect()
- : null
- }
- onInput={(e): void => setURL(e?.currentTarget.value)}
- />
- </p>
- </div>
- </div>
- </div>
- </section>
- <footer
- class="modal-card-foot "
- style={{
- justifyContent: "flex-end",
- border: "1px solid",
- borderTop: 0,
- }}
- >
- <AsyncButton onClick={doConnect}>
- <i18n.Translate>Connect</i18n.Translate>
- </AsyncButton>
- </footer>
- </div>
- </div>
- </div>
- );
-} \ No newline at end of file