refactor: Code formatting (#108)
All checks were successful
/ test (push) Successful in 3m34s
All checks were successful
/ test (push) Successful in 3m34s
Primarily, switch to using trailing commas. Also uniformizes commas with respect to switch branches, makes function call layout more consistent, line breaking more consistent, alphabetizes imports, uses the field init shorthand when possible, etc. Resolves #99. Co-authored-by: Aaron Fenyes <aaron.fenyes@fareycircles.ooo> Reviewed-on: #108 Co-authored-by: Vectornaut <vectornaut@nobody@nowhere.net> Co-committed-by: Vectornaut <vectornaut@nobody@nowhere.net>
This commit is contained in:
parent
2eba80fb69
commit
ef1a579ac0
12 changed files with 310 additions and 297 deletions
|
@ -4,15 +4,15 @@ use sycamore::prelude::*;
|
|||
use super::test_assembly_chooser::TestAssemblyChooser;
|
||||
use crate::{
|
||||
AppState,
|
||||
assembly::{InversiveDistanceRegulator, Point, Sphere}
|
||||
assembly::{InversiveDistanceRegulator, Point, Sphere},
|
||||
};
|
||||
|
||||
#[component]
|
||||
pub fn AddRemove() -> View {
|
||||
view! {
|
||||
div(id="add-remove") {
|
||||
div(id = "add-remove") {
|
||||
button(
|
||||
on:click=|_| {
|
||||
on:click = |_| {
|
||||
let state = use_context::<AppState>();
|
||||
batch(|| {
|
||||
// this call is batched to avoid redundant realizations.
|
||||
|
@ -33,18 +33,18 @@ pub fn AddRemove() -> View {
|
|||
}
|
||||
) { "Add sphere" }
|
||||
button(
|
||||
on:click=|_| {
|
||||
on:click = |_| {
|
||||
let state = use_context::<AppState>();
|
||||
state.assembly.insert_element_default::<Point>();
|
||||
}
|
||||
) { "Add point" }
|
||||
button(
|
||||
class="emoji", /* KLUDGE */ // for convenience, we're using an emoji as a temporary icon for this button
|
||||
disabled={
|
||||
class = "emoji", /* KLUDGE */ // for convenience, we're using an emoji as a temporary icon for this button
|
||||
disabled = {
|
||||
let state = use_context::<AppState>();
|
||||
state.selection.with(|sel| sel.len() != 2)
|
||||
},
|
||||
on:click=|_| {
|
||||
on:click = |_| {
|
||||
let state = use_context::<AppState>();
|
||||
let subjects: [_; 2] = state.selection.with(
|
||||
// the button is only enabled when two elements are
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue