Skip to content

Commit bb35ba3

Browse files
authored
Merge pull request #7 from DefichainCommunity/main
make input field visible
2 parents 9523978 + f5ab60e commit bb35ba3

2 files changed

Lines changed: 22 additions & 15 deletions

File tree

frontend/src/vanillaswap/swap_v2.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,13 @@ pub fn PoolV2Swap() -> Element {
178178
button { class: "px-3 py-1 bg-white/10 rounded-lg text-white", onclick: on_max_click, "Max" }
179179
}
180180

181-
input {
182-
class: "mt-4 w-full bg-transparent text-right text-2xl text-white focus:outline-none",
183-
placeholder: "Amount",
184-
value: "{amount_in.read()}",
185-
oninput: move |e| amount_in.set(e.value().to_string())
181+
div { class: "mt-2 flex justify-end ",
182+
input {
183+
class: "mt-4 w-1/3 bg-white/10 text-right text-2xl text-white rounded-lg px-2",
184+
placeholder: "Amount",
185+
value: "{amount_in.read()}",
186+
oninput: move |e| amount_in.set(e.value().to_string())
187+
}
186188
}
187189
}
188190

@@ -220,16 +222,18 @@ pub fn PoolV2Swap() -> Element {
220222
}
221223
}
222224
div { class: "mt-4 text-2xl text-right text-gray-200", "out≈ {amount_out()}" }
223-
div { class: "mt-4 text-2xl text-right text-gray-200",
225+
div { class: "mt-4 text-right text-gray-200",
226+
div { class: "mt-2 flex justify-end ",
224227
input {
225-
class: "mt-4 w-full bg-transparent text-right text-2xl text-white focus:outline-none",
228+
class: "mt-4 w-1/4 bg-white/10 text-right text-2xl text-white rounded-lg px-2",
226229
value: "{slippage_percent.read()}",
227230
oninput: move |e| {
228231
if let Ok(v) = e.value().parse::<f64>() {
229232
slippage_percent.set(v);
230233
}
231234
}
232235
}
236+
}
233237
div { class: "text-sm text-gray-400", "slippage %" }
234238
}
235239

frontend/src/vanillaswap/swap_v3.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ pub fn PoolV3Swap() -> Element {
3535
spawn_local(async move {
3636
calculating.set(true);
3737
let new_amount = approx_amount_out(&amount_in.read(),&token_a.read(), &token_b.read(), &pools.pairs.read(), &pools.pool_state.read());
38-
log::debug!("New Amount out : {}", new_amount);
3938
amount_out.set(new_amount);
4039
calculating.set(false);
4140
});
@@ -183,11 +182,13 @@ pub fn PoolV3Swap() -> Element {
183182
button { class: "px-3 py-1 bg-white/10 rounded-lg text-white", onclick: on_max_click, "Max" }
184183
}
185184

186-
input {
187-
class: "mt-4 w-full bg-transparent text-right text-2xl text-white focus:outline-none",
188-
placeholder: "Amount",
189-
value: "{amount_in.read()}",
190-
oninput: move |e| amount_in.set(e.value().to_string())
185+
div { class: "mt-2 flex justify-end ",
186+
input {
187+
class: "mt-4 w-1/3 bg-white/10 text-right text-2xl text-white rounded-lg px-21",
188+
placeholder: "Amount",
189+
value: "{amount_in.read()}",
190+
oninput: move |e| amount_in.set(e.value().to_string())
191+
}
191192
}
192193
}
193194

@@ -225,16 +226,18 @@ pub fn PoolV3Swap() -> Element {
225226
}
226227
}
227228
div { class: "mt-4 text-2xl text-right text-gray-200", "out≈ {amount_out()}" }
228-
div { class: "mt-4 text-2xl text-right text-gray-200",
229+
div { class: "mt-4 text-right text-gray-200",
230+
div { class: "mt-2 flex justify-end ",
229231
input {
230-
class: "mt-4 w-full bg-transparent text-right text-2xl text-white focus:outline-none",
232+
class: "mt-4 w-1/4 bg-white/10 text-right text-2xl text-white rounded-lg px-2",
231233
value: "{slippage_percent.read()}",
232234
oninput: move |e| {
233235
if let Ok(v) = e.value().parse::<f64>() {
234236
slippage_percent.set(v);
235237
}
236238
}
237239
}
240+
}
238241
div { class: "text-sm text-gray-400", "slippage %" }
239242
}
240243

0 commit comments

Comments
 (0)