Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 165 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

- Install [rust](https://rust-lang.org/tools/install/)
- Install [dioxus](https://dioxuslabs.com/learn/0.7/getting_started/#install-the-dioxus-cli)
- Install PostgreSql

## Database setup

Open a `psql` shell and type:

```
CREATE DATABASE mindr_dev;
```


## Run client in web
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/mindmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use dioxus::prelude::*;
use std::rc::Rc;

#[component]
pub fn Mindmap() -> Element {
let store = Store::new();
pub fn Mindmap(channel_id: String) -> Element {
let store = Store::new(channel_id);
let mut pane = store.pane;
let mut graph = store.graph;

Expand Down
2 changes: 1 addition & 1 deletion client/src/data/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct Connection {
}

impl Connection {
pub fn new(graph: Graph) -> Self {
pub fn new(graph: Graph, channel_id: String) -> Self {
let doc = graph.get_doc();
let coroutine = use_coroutine(move |mut rx: UnboundedReceiver<Message>| {
let mut doc = doc;
Expand Down
4 changes: 2 additions & 2 deletions client/src/data/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ pub struct Store {
}

impl Store {
pub fn new() -> Self {
pub fn new(channel_id: String) -> Self {
let graph = Graph::new();
Self {
graph,
pane: Pane::new(),
connection: Connection::new(graph),
connection: Connection::new(graph, channel_id),
}
}
}
18 changes: 3 additions & 15 deletions client/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use dioxus::prelude::*;

use components::Mindmap;

mod components;
mod data;
mod router;

const FAVICON: Asset = asset!("/assets/favicon.ico");
const MAIN_CSS: Asset = asset!("/assets/css/main.css");
use router::Route;

fn main() {
dioxus::launch(App);
Expand All @@ -15,16 +13,6 @@ fn main() {
#[component]
fn App() -> Element {
rsx! {
document::Style {
{
format!(
" @font-face {{ font-family: 'Roboto Light'; src: url({}) format('truetype');}} ",
asset!("/assets/fonts/Roboto-Light.ttf"),
)
}
}
document::Link { rel: "icon", href: FAVICON }
document::Link { rel: "stylesheet", href: MAIN_CSS }
Mindmap {}
Router::<Route> {}
}
}
Loading
Loading