Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kent-3 committed Oct 18, 2024
1 parent 70872d4 commit d705e24
Show file tree
Hide file tree
Showing 7 changed files with 242 additions and 147 deletions.
12 changes: 6 additions & 6 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@



<script type="module" nonce="F/Z91LPSLhIzS7KMYnsePQ==">
import init, * as bindings from '/trader-leptos-8b647d9bc3b39c8c.js';
const wasm = await init('/trader-leptos-8b647d9bc3b39c8c_bg.wasm');
<script type="module" nonce="t0LfUgPd4UXIy4DCAb95cQ==">
import init, * as bindings from '/trader-leptos-6572d88cbc04ebda.js';
const wasm = await init('/trader-leptos-6572d88cbc04ebda_bg.wasm');


window.wasmBindings = bindings;
Expand All @@ -21,7 +21,7 @@

</script>
<link rel="icon" href="/favicon-e9cbd8f50cc65bf2.ico" integrity="sha384&#x2D;YobgLXwtz0GhXVUTHml49p32guapVFlEG8UpQdDVN3kekOqkQi&#x2B;qSXEpwp&#x2B;yM4BW"/>
<link rel="stylesheet" href="/input-25a153b2034a62ff.css" integrity="sha384&#x2D;Iu&#x2B;P9m3tm8k893MFc&#x2F;KnVPTJOexPdGYpJElFBfLOsKySa4kfOrma4ZVKbY16K&#x2F;y1"/>
<link rel="stylesheet" href="/input-c25a8054e7f7914f.css" integrity="sha384&#x2D;N1hIRfZuUVgBglWppLexnisnkglkz7n3pbSW4Qo&#x2B;jPgAJh7FzGIWwOSkQ5NNDvCV"/>

<link rel="manifest" href="/secret-leptos/manifest.json" />

Expand All @@ -44,8 +44,8 @@
});
</script>

<link rel="modulepreload" href="/trader-leptos-8b647d9bc3b39c8c.js" crossorigin=anonymous integrity="sha384-G0pT/sV2fRg3mkGt6aK3ATp/CEXIrKd9jLJ2FCkNV0QVGCe4mhBcKYGCdWc1oiSa">
<link rel="preload" href="/trader-leptos-8b647d9bc3b39c8c_bg.wasm" crossorigin=anonymous integrity="sha384-wmDole4HJzedoJC2/pu5P6FlsD62DqU9vLQMBnvu4EUA7lcD3t6VGvz5xJBBikMB" as="fetch" type="application/wasm"></head>
<link rel="modulepreload" href="/trader-leptos-6572d88cbc04ebda.js" crossorigin=anonymous integrity="sha384-vlHYhpp/ywnGR+q7fi6RnLvNPrghGYorK4rlfGeoZn+EZbCMxAJBJTXTTayBu9J2">
<link rel="preload" href="/trader-leptos-6572d88cbc04ebda_bg.wasm" crossorigin=anonymous integrity="sha384-hJ8wrz93xIpfV2Q9qz8m6yBKeQPoS41EwILpAD/uIv+vZixdrg+KTvlsQt9lJFpT" as="fetch" type="application/wasm"></head>

<style>
.spinner {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
width: 7rem;
}

.w-64 {
width: 16rem;
}

.w-8 {
width: 2rem;
}
Expand All @@ -154,11 +158,6 @@
width: 100%;
}

.min-w-fit {
min-width: -moz-fit-content;
min-width: fit-content;
}

.max-w-\[320px\] {
max-width: 320px;
}
Expand Down Expand Up @@ -197,6 +196,10 @@
animation: spin 1s linear infinite;
}

.cursor-default {
cursor: default;
}

.cursor-pointer {
cursor: pointer;
}
Expand Down Expand Up @@ -575,6 +578,20 @@ body {
color: rgb(229 229 229 / var(--tw-text-opacity));
}

::-moz-selection {
--tw-bg-opacity: 1;
background-color: rgb(124 58 237 / var(--tw-bg-opacity));
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}

::selection {
--tw-bg-opacity: 1;
background-color: rgb(124 58 237 / var(--tw-bg-opacity));
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}

a[aria-current] {
font-weight: bold;
}
Expand Down Expand Up @@ -921,10 +938,6 @@ ul {
}
}

.hover\:cursor-default:hover {
cursor: default;
}

.hover\:bg-neutral-800:hover {
--tw-bg-opacity: 1;
background-color: rgb(38 38 38 / var(--tw-bg-opacity));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,6 @@ function __wbg_get_imports() {
const ret = typeof(val) === 'object' && val !== null;
return ret;
};
imports.wbg.__wbindgen_is_null = function(arg0) {
const ret = getObject(arg0) === null;
return ret;
};
imports.wbg.__wbindgen_cb_drop = function(arg0) {
const obj = takeObject(arg0).original;
if (obj.cnt-- == 1) {
Expand All @@ -549,6 +545,10 @@ function __wbg_get_imports() {
const ret = false;
return ret;
};
imports.wbg.__wbindgen_is_null = function(arg0) {
const ret = getObject(arg0) === null;
return ret;
};
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
const ret = new Error(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
Expand Down Expand Up @@ -1371,44 +1371,44 @@ function __wbg_get_imports() {
const ret = wasm.memory;
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper17630 = function(arg0, arg1, arg2) {
const ret = makeClosure(arg0, arg1, 1795, __wbg_adapter_48);
imports.wbg.__wbindgen_closure_wrapper17509 = function(arg0, arg1, arg2) {
const ret = makeClosure(arg0, arg1, 1200, __wbg_adapter_48);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper17632 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1799, __wbg_adapter_51);
imports.wbg.__wbindgen_closure_wrapper17511 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1204, __wbg_adapter_51);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper21768 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2477, __wbg_adapter_54);
imports.wbg.__wbindgen_closure_wrapper21817 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2488, __wbg_adapter_54);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper21773 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2477, __wbg_adapter_57);
imports.wbg.__wbindgen_closure_wrapper21822 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2488, __wbg_adapter_57);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper21775 = function(arg0, arg1, arg2) {
const ret = makeClosure(arg0, arg1, 2477, __wbg_adapter_60);
imports.wbg.__wbindgen_closure_wrapper21824 = function(arg0, arg1, arg2) {
const ret = makeClosure(arg0, arg1, 2488, __wbg_adapter_60);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper22158 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2657, __wbg_adapter_63);
imports.wbg.__wbindgen_closure_wrapper22207 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2668, __wbg_adapter_63);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper22449 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2772, __wbg_adapter_66);
imports.wbg.__wbindgen_closure_wrapper22498 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2783, __wbg_adapter_66);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper24011 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 3474, __wbg_adapter_69);
imports.wbg.__wbindgen_closure_wrapper24060 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 3485, __wbg_adapter_69);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper24013 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 3474, __wbg_adapter_69);
imports.wbg.__wbindgen_closure_wrapper24062 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 3485, __wbg_adapter_69);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper25705 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 3530, __wbg_adapter_74);
imports.wbg.__wbindgen_closure_wrapper25754 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 3541, __wbg_adapter_74);
return addHeapObject(ret);
};

Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions input.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ body {
@apply bg-neutral-900 text-neutral-200;
}

::selection {
@apply bg-violet-600 text-white;
}

a[aria-current] {
font-weight: bold;
}
Expand Down
26 changes: 16 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,11 @@ pub fn OptionsMenu(
) -> impl IntoView {
info!("rendering <OptionsMenu/>");

// let dialog_ref = NodeRef::<Dialog>::new();
let input_element = NodeRef::<Input>::new();
let url_input = NodeRef::<Input>::new();
let chain_id_input = NodeRef::<Input>::new();

let endpoint = use_context::<Endpoint>().expect("endpoint context missing!");
let chain_id = use_context::<ChainId>().expect("chain id context missing!");
let keplr = use_context::<KeplrSignals>().expect("keplr signals context missing!");

let disable_keplr = move |_| {
Expand All @@ -285,11 +286,8 @@ pub fn OptionsMenu(
let on_submit = move |ev: leptos::ev::SubmitEvent| {
// stop the page from reloading!
ev.prevent_default();

debug!("updating wasm_client grpc_url");

// here, we'll extract the value from the input
let value = input_element
let value = url_input
.get()
// event handlers can only fire after the view
// is mounted to the DOM, so the `NodeRef` will be `Some`
Expand All @@ -299,7 +297,13 @@ pub fn OptionsMenu(
// this means we can call`HtmlInputElement::value()`
// to get the current value of the input
.value();
endpoint.set(value)
endpoint.set(value);

let value = chain_id_input
.get()
.expect("<input> should be mounted")
.value();
chain_id.set(value);
};

view! {
Expand All @@ -310,9 +314,11 @@ pub fn OptionsMenu(
<button on:click=toggle_menu class="self-stretch">
"Close Menu"
</button>
<form class="flex gap-4" on:submit=on_submit>
<input type="text" value=GRPC_URL node_ref=input_element />
<input type="submit" value="Submit" class="min-w-fit" />
<div> "Node Configuration" </div>
<form class="flex flex-col gap-4" on:submit=on_submit>
<input type="text" value=GRPC_URL node_ref=url_input class="w-64" />
<input type="text" value=CHAIN_ID node_ref=chain_id_input />
<input type="submit" value="Update" class="" />
</form>
<button
on:click=disable_keplr
Expand Down
Loading

0 comments on commit d705e24

Please sign in to comment.