0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 17:00:36 -05:00

Add confirm dialog placeholder.

This commit is contained in:
Andrey Antukh 2016-04-02 11:26:06 +03:00
parent f7013d6e8b
commit 3d17eca0d2
3 changed files with 37 additions and 2 deletions

32
src/uxbox/ui/confirm.cljs Normal file
View file

@ -0,0 +1,32 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
;; Copyright (c) 2016 Juan de la Cruz <delacruzgarciajuan@gmail.com>
(ns uxbox.ui.confirm
(:require [sablono.core :as html :refer-macros [html]]
[uxbox.ui.icons :as i]
[uxbox.ui.mixins :as mx]
[uxbox.util.dom :as dom]
[uxbox.ui.lightbox :as lightbox]))
(defn- confirm-dialog-render
[own]
(html
[:div.lightbox-body.confirm-dialog
[:span "HERE"]
[:a.close {:href "#"
:on-click #(do (dom/prevent-default %)
(lightbox/close!))} i/close]]))
(def confirm-dialog
(mx/component
{:render confirm-dialog-render
:name "confirm-dialog"
:mixins []}))
(defmethod lightbox/render-lightbox :confirm
[_]
(confirm-dialog))

View file

@ -18,6 +18,7 @@
[uxbox.ui.icons :as i]
[uxbox.ui.mixins :as mx]
[uxbox.ui.messages :as uum]
[uxbox.ui.confirm]
[uxbox.ui.workspace.base :as uuwb]
[uxbox.ui.workspace.shortcuts :as wshortcuts]
[uxbox.ui.workspace.header :refer (header)]

View file

@ -60,7 +60,8 @@
flags (rum/react wb/flags-l)
toggle #(rs/emit! (dw/toggle-flag %))
;; TODO: temporary
open-clipboard-dialog #(lightbox/open! :clipboard)]
open-clipboard-dialog #(lightbox/open! :clipboard)
open-confirm-dialog #(lightbox/open! :confirm)]
(html
[:header#workspace-bar.workspace-bar
[:div.main-icon
@ -102,7 +103,8 @@
:on-click open-clipboard-dialog}
i/undo]
[:li.tooltip.tooltip-bottom
{:alt "Redo (Ctrl + Shift + Z)"}
{:alt "Redo (Ctrl + Shift + Z)"
:on-click open-confirm-dialog}
i/redo]]
[:ul.options-btn
;; TODO: refactor