From 5f3ed30d21136cda28c124e4e96f4c12a2da0bb4 Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Thu, 8 Feb 2024 15:56:59 +0000 Subject: [PATCH] Improve post delete style --- app/assets/stylesheets/microposts.sass | 12 +++++++++++- app/views/microposts/_micropost.html.haml | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/microposts.sass b/app/assets/stylesheets/microposts.sass index feec0190..50474098 100644 --- a/app/assets/stylesheets/microposts.sass +++ b/app/assets/stylesheets/microposts.sass @@ -8,7 +8,7 @@ ol.microposts padding: 0 .micropost - .display-name, .timestamp + .display-name, .timestamp, .delete font-family: "Press Start 2P", "Anton", Impact, fantasy, sans-serif font-size: .4em margin: 1em @@ -18,3 +18,13 @@ ol.microposts font-family: sans font-size: .8em text-shadow: none + .delete + &.emoji + font-size: .6em + a + text-shadow: -1px 1px #e1b027, 1px -1px #00ddff + &.text a + color: #cc0000 + text-shadow: -1px 1px #e1b027, 1px -1px #00ddff + // a + color: #111111 diff --git a/app/views/microposts/_micropost.html.haml b/app/views/microposts/_micropost.html.haml index c0a3ebbd..e7d379c7 100644 --- a/app/views/microposts/_micropost.html.haml +++ b/app/views/microposts/_micropost.html.haml @@ -3,5 +3,6 @@ %span.display-name= link_to micropost.micropostable.display_name, micropost.micropostable %span.timestamp #{time_ago_in_words(micropost.created_at)} ago. - if policy(micropost).destroy? - %span= link_to "❌", micropost, method: :delete, data: { confirm: 'Are you sure?' } + %span.delete.emoji= link_to "❌", micropost, method: :delete, data: { confirm: 'Delete Post. Are you sure?' } + %span.delete.text= link_to "Delete", micropost, method: :delete, data: { confirm: 'Delete Post. Are you sure?' } %span.content= micropost.content