From ebdce733da9c24fe5c37eb6253938837e884505b Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 23 Dec 2021 11:27:08 +0800 Subject: [PATCH] enhance: fix ui/button minor differences in iOS --- src/main/frontend/ui.cljs | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/main/frontend/ui.cljs b/src/main/frontend/ui.cljs index 97541fee5..54f7f8ced 100644 --- a/src/main/frontend/ui.cljs +++ b/src/main/frontend/ui.cljs @@ -164,19 +164,16 @@ klass (if background (string/replace klass "indigo" background) klass) klass (if small? (str klass ".px-2.py-1") klass) klass (if large? (str klass ".text-base") klass)] - (if href - [:a.ui__button.is-link - (merge - {:type "button" - :class (str (util/hiccup->class klass) " " class)} - (dissoc option :background :class :small?)) - text] - [:button.ui__button - (merge - {:type "button" - :class (str (util/hiccup->class klass) " " class)} - (dissoc option :background :class :small?)) - text]))) + [:button.ui__button + (merge + {:type "button" + :class (str (util/hiccup->class klass) " " class)} + (dissoc option :background :class :small?) + (when href + {:on-click (fn [] + (set! (.-href js/window.location) href) + (when (fn? on-click) (on-click)))})) + text])) (rum/defc notification-content [state content status uid]