From 065d786dd70e349a6d6f641fb9ebdfbf2283afca Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Mon, 31 May 2021 19:09:11 -0500 Subject: [PATCH] Updated ToggleableButton to support no additional attributes. --- src/MultiShop/Client/Shared/ToggleableButton.razor | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/MultiShop/Client/Shared/ToggleableButton.razor b/src/MultiShop/Client/Shared/ToggleableButton.razor index 89d332a..7c75896 100644 --- a/src/MultiShop/Client/Shared/ToggleableButton.razor +++ b/src/MultiShop/Client/Shared/ToggleableButton.razor @@ -17,12 +17,5 @@ private bool state; - private string ButtonClasses - { - get - { - IReadOnlyDictionary t = AdditionalAttributes; - return (state ? "active " : "") + (AdditionalAttributes["class"] as string); - } - } + private string ButtonClasses => (state ? "active " : null) + (AdditionalAttributes != null && AdditionalAttributes.ContainsKey("class") ? AdditionalAttributes["class"] as string : null); } \ No newline at end of file