Skip to content

Commit

Permalink
chore: remove unneeded ghactions ymls, move logo a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
alardev committed Mar 2, 2024
1 parent f56d65c commit 21dc0cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 51 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/static.yml

This file was deleted.

16 changes: 14 additions & 2 deletions site/src/pages/transliterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,21 @@ use web_sys::MouseEvent;

pub fn copy_selected_text_to_clipboard(el: MouseEvent, content: String) {
log::warn!("Copying text to clipboard..");

let transforming_class =
use_context::<ReadSignal<String>>().expect("to have found the getter provided");

let text = match transforming_class.get().as_str() {
"capitalize" => uppercase_words(&content), // Convert to String for consistency
"uppercase" => content.to_uppercase(), // Returns a String, so it's owned
"lowercase" => content.to_lowercase(), // Returns a String
"normal-case" => content,
_ => "".to_string(),
};

#[cfg(web_sys_unstable_apis)]
if let Some(clipboard) = window().navigator().clipboard() {
clipboard.write_text(&content);
clipboard.write_text(text);
} else {
log::error!("Clipboard is not supported");
}
Expand Down Expand Up @@ -279,7 +291,7 @@ fn Name(name: ReadSignal<String>) -> impl IntoView {
"uppercase" => name.get().to_uppercase(), // Returns a String, so it's owned
"lowercase" => name.get().to_lowercase(), // Returns a String
"normal-case" => name.get(),
_ => "wtf".to_string(),
_ => "".to_string(),
}
}
}
Expand Down

0 comments on commit 21dc0cb

Please sign in to comment.