From cf10f63af4ef38e199412e0e20eb84c048b62fd7 Mon Sep 17 00:00:00 2001 From: eikek Date: Mon, 16 Aug 2021 17:00:57 +0200 Subject: [PATCH] Improve main view in home page --- .../webapp/src/main/elm/Page/Home/View2.elm | 51 +++++++++++-------- modules/webapp/src/main/elm/Styles.elm | 5 -- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/modules/webapp/src/main/elm/Page/Home/View2.elm b/modules/webapp/src/main/elm/Page/Home/View2.elm index 0bf0711a..6a7a62a5 100644 --- a/modules/webapp/src/main/elm/Page/Home/View2.elm +++ b/modules/webapp/src/main/elm/Page/Home/View2.elm @@ -51,11 +51,7 @@ viewContent texts flags settings model = ] (searchStats texts flags settings model ++ itemsBar texts flags settings model - ++ [ div [ class "sm:relative" ] - (itemMergeView texts settings model - ++ itemCardList texts flags settings model - ) - ] + ++ mainView texts flags settings model ++ confirmModal texts model ) @@ -64,26 +60,37 @@ viewContent texts flags settings model = --- Helpers -itemMergeView : Texts -> UiSettings -> Model -> List (Html Msg) -itemMergeView texts settings model = - case model.viewMode of - SelectView svm -> - case svm.action of - MergeSelected -> - [ div - [ class S.dimmerMerge - , class "mt-10 sm:mt-0" - ] - [ Html.map MergeItemsMsg - (Comp.ItemMerge.view texts.itemMerge settings svm.mergeModel) - ] - ] +mainView : Texts -> Flags -> UiSettings -> Model -> List (Html Msg) +mainView texts flags settings model = + let + mergeView = + case model.viewMode of + SelectView svm -> + case svm.action of + MergeSelected -> + Just svm + + _ -> + Nothing _ -> - [] + Nothing + in + case mergeView of + Just svm -> + [ div [ class "sm:relative mb-2" ] + (itemMergeView texts settings svm) + ] - _ -> - [] + Nothing -> + itemCardList texts flags settings model + + +itemMergeView : Texts -> UiSettings -> SelectViewModel -> List (Html Msg) +itemMergeView texts settings svm = + [ Html.map MergeItemsMsg + (Comp.ItemMerge.view texts.itemMerge settings svm.mergeModel) + ] confirmModal : Texts -> Model -> List (Html Msg) diff --git a/modules/webapp/src/main/elm/Styles.elm b/modules/webapp/src/main/elm/Styles.elm index 7191bd27..e92b29fe 100644 --- a/modules/webapp/src/main/elm/Styles.elm +++ b/modules/webapp/src/main/elm/Styles.elm @@ -343,11 +343,6 @@ dimmerCard = " absolute top-0 left-0 w-full h-full bg-black bg-opacity-60 dark:bg-lightblue-900 dark:bg-opacity-60 z-30 flex flex-col items-center justify-center px-4 py-2 " -dimmerMerge : String -dimmerMerge = - " absolute top-0 left-0 w-full h-full bg-white bg-opacity-100 dark:bg-bluegray-800 dark:bg-opacity-100 z-40 flex flex-col" - - tableMain : String tableMain = "border-collapse table w-full"