Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit b0a479f

Browse files
committed
refactor: editor
1 parent 78d8227 commit b0a479f

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/editor/cmpx_editor.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
21
use leptos::*;
32

43
#[component]
5-
pub fn CmpxEditor(
6-
content: ReadSignal<String>,
7-
set_content: WriteSignal<String>
8-
) -> impl IntoView {
9-
4+
pub fn CmpxEditor(content: ReadSignal<String>, set_content: WriteSignal<String>) -> impl IntoView {
105
view! {
116
<textarea
127
class="code-editor"
138
type="text"
149
on:input=move |ev| {
15-
set_content.set(event_target_value(&ev));
10+
set_content.set(event_target_value(&ev));
1611
}
12+
1713
prop:value=content.get()
1814
rows=40
1915
style="margin: 10px;"

src/editor/fileedit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use super::cmpx_editor::CmpxEditor;
12
use crate::editor::analyze::parse;
23
use leptonic::prelude::Button;
34
use leptonic::prelude::Col;
@@ -13,7 +14,6 @@ use leptonic::prelude::ThemeToggle;
1314
use leptos::leptos_dom::helpers::IntervalHandle;
1415
use leptos::*;
1516
use web_time::Duration;
16-
use super::cmpx_editor::CmpxEditor;
1717

1818
#[component]
1919
pub fn FileEditor() -> impl IntoView {
@@ -80,7 +80,7 @@ pub fn FileEditor() -> impl IntoView {
8080
<Row>
8181
// editor region
8282
<Col md=6 sm=1 xs=1>
83-
<CmpxEditor content=content set_content=set_content/>
83+
<CmpxEditor content=content set_content=set_content/>
8484
</Col>
8585
// editor region end
8686

src/editor/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
mod analyze;
2-
mod fileedit;
32
mod cmpx_editor;
3+
mod fileedit;
44

55
use fileedit::FileEditor;
66
use leptos::*;

0 commit comments

Comments
 (0)