Skip to content

Commit

Permalink
Unecessary lib.rs -> commands.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
shettysach committed Mar 7, 2024
1 parent 83a0ec5 commit 0068ce3
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 40 deletions.
28 changes: 0 additions & 28 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ leptos-use = "0.9.0"
reqwest = { version = "0.11.23", features = ["json"] }
serde = "1.0.195"
serde_json = "1.0.111"
stylers = "0.3.2"
tokio = { version = "1.35.1", features = ["macros", "sync"] }
3 changes: 2 additions & 1 deletion src/base/banner.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use crate::commands::banner;
use leptos::{component, view, IntoView};

#[component]
pub fn Banner() -> impl IntoView {
let banner = termfolio::banner();
let banner = banner();

view! {
<p class="inline">"user@termfolio:~$ "</p>
Expand Down
3 changes: 2 additions & 1 deletion src/base/prompt/general.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::commands::Command;
use leptos::{ReadSignal, Signal, SignalGetUntracked, SignalUpdate, WriteSignal};
use leptos_use::ColorMode;
use std::collections::VecDeque;
Expand Down Expand Up @@ -39,7 +40,7 @@ pub async fn general_commands<F>(
r#"Theme changed to: <b class="grn">{new_theme}</b>"#
));
}
_ => set_out(termfolio::Command::process(val.0, val.1).await),
_ => set_out(Command::process(val.0, val.1).await),
}

updater.update(|hist| {
Expand Down
3 changes: 2 additions & 1 deletion src/base/prompt/keyboard.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::commands::autocomplete;
use leptos::ev::{keydown, KeyboardEvent};
use leptos::html::Input;
use leptos::{NodeRef, ReadSignal, SignalGetUntracked, SignalUpdate, WriteSignal};
Expand Down Expand Up @@ -38,7 +39,7 @@ pub fn keyboard_commands(
//Autocomplete
"Tab" => {
ev.prevent_default();
inp.set_value(termfolio::autocomplete(&inp.value()));
inp.set_value(autocomplete(&inp.value()));
}
_ => {}
}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/fetch.rs → src/commands/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ use tokio::try_join;

// Formnatting functions and error messages
mod formats;
use crate::texts::{FETCH_GITHUB_ERROR, READ_JSON_ERROR};
use crate::commands::texts::{FETCH_GITHUB_ERROR, READ_JSON_ERROR};
use formats::*;

// Structs for JSON Parsing
mod structs;
use structs::*;

// Config JSON
const JSON: &str = include_str!("../configs/config.json");
const JSON: &str = include_str!("../../configs/config.json");

// Once statics

Expand Down
12 changes: 6 additions & 6 deletions src/fetch/formats.rs → src/commands/fetch/formats.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use crate::fetch::{About, Links, Repository, UserInfo, UserStats};
use crate::commands::fetch::{About, Links, Repository, UserInfo, UserStats};
use std::collections::HashMap;

// Ascii art used for Github
const NEOFETCH: &str = include_str!("../../configs/neofetch.txt");
const NEOFETCH: &str = include_str!("../../../configs/neofetch.txt");

// Language icons for repos
const RUST: &str = include_str!("../../configs/lang_icons/ferris.txt");
const PYTHON: &str = include_str!("../../configs/lang_icons/pythons.txt");
const JAVASCRIPT: &str = include_str!("../../configs/lang_icons/javascript.txt");
const PLACEHOLDER: &str = include_str!("../../configs/lang_icons/octocat.txt");
const RUST: &str = include_str!("../../../configs/lang_icons/ferris.txt");
const PYTHON: &str = include_str!("../../../configs/lang_icons/pythons.txt");
const JAVASCRIPT: &str = include_str!("../../../configs/lang_icons/javascript.txt");
const PLACEHOLDER: &str = include_str!("../../../configs/lang_icons/octocat.txt");

pub fn format_about(about: About) -> String {
let exp_string: String = about
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use leptos::view;

mod base;
mod commands;
use base::Base;

fn main() {
Expand Down

0 comments on commit 0068ce3

Please sign in to comment.