From 5718f55b9a3ffb35cf599ea8475afbed6e06ae60 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Mon, 8 Oct 2018 18:55:30 +0300 Subject: [PATCH] Fix tooltip width --- client/src/components/Dashboard/Counters.js | 14 ++++++++------ client/src/components/Settings/Settings.css | 4 ++++ client/src/components/ui/Card.css | 4 ++-- client/src/components/ui/Tooltip.css | 8 ++++++-- client/src/components/ui/Tooltip.js | 3 ++- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/client/src/components/Dashboard/Counters.js b/client/src/components/Dashboard/Counters.js index 44a9d188..6292e11f 100644 --- a/client/src/components/Dashboard/Counters.js +++ b/client/src/components/Dashboard/Counters.js @@ -4,6 +4,8 @@ import PropTypes from 'prop-types'; import Card from '../ui/Card'; import Tooltip from '../ui/Tooltip'; +const tooltipType = 'tooltip-custom--narrow'; + const Counters = props => ( @@ -11,7 +13,7 @@ const Counters = props => (
DNS Queries - + @@ -22,7 +24,7 @@ const Counters = props => (
Blocked by filters - + @@ -33,7 +35,7 @@ const Counters = props => (
Blocked malware/phishing - + @@ -44,7 +46,7 @@ const Counters = props => (
Blocked adult websites - + @@ -55,7 +57,7 @@ const Counters = props => (
Enforced safe search - + @@ -66,7 +68,7 @@ const Counters = props => (
Average processing time - + diff --git a/client/src/components/Settings/Settings.css b/client/src/components/Settings/Settings.css index 1fe91e9b..380a70f6 100644 --- a/client/src/components/Settings/Settings.css +++ b/client/src/components/Settings/Settings.css @@ -14,3 +14,7 @@ .form-control--textarea { min-height: 110px; } + +.form-control--textarea-large { + min-height: 240px; +} diff --git a/client/src/components/ui/Card.css b/client/src/components/ui/Card.css index 8269c2df..0aaeea01 100644 --- a/client/src/components/ui/Card.css +++ b/client/src/components/ui/Card.css @@ -40,11 +40,11 @@ background-size: 14px; background-position: center; background-repeat: no-repeat; - background-image: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiM0NjdmY2YiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMjMgNHY2aC02Ii8+PHBhdGggZD0ibTEgMjB2LTZoNiIvPjxwYXRoIGQ9Im0zLjUxIDlhOSA5IDAgMCAxIDE0Ljg1LTMuMzZsNC42NCA0LjM2bS0yMiA0IDQuNjQgNC4zNmE5IDkgMCAwIDAgMTQuODUtMy4zNiIvPjwvc3ZnPg=='); + background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiM0NjdmY2YiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMjMgNHY2aC02Ii8+PHBhdGggZD0ibTEgMjB2LTZoNiIvPjxwYXRoIGQ9Im0zLjUxIDlhOSA5IDAgMCAxIDE0Ljg1LTMuMzZsNC42NCA0LjM2bS0yMiA0IDQuNjQgNC4zNmE5IDkgMCAwIDAgMTQuODUtMy4zNiIvPjwvc3ZnPg=="); } .card-refresh:hover, .card-refresh:not(:disabled):not(.disabled):active, .card-refresh:focus:active { - background-image: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMjMgNHY2aC02Ii8+PHBhdGggZD0ibTEgMjB2LTZoNiIvPjxwYXRoIGQ9Im0zLjUxIDlhOSA5IDAgMCAxIDE0Ljg1LTMuMzZsNC42NCA0LjM2bS0yMiA0IDQuNjQgNC4zNmE5IDkgMCAwIDAgMTQuODUtMy4zNiIvPjwvc3ZnPg=='); + background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMjMgNHY2aC02Ii8+PHBhdGggZD0ibTEgMjB2LTZoNiIvPjxwYXRoIGQ9Im0zLjUxIDlhOSA5IDAgMCAxIDE0Ljg1LTMuMzZsNC42NCA0LjM2bS0yMiA0IDQuNjQgNC4zNmE5IDkgMCAwIDAgMTQuODUtMy4zNiIvPjwvc3ZnPg=="); } diff --git a/client/src/components/ui/Tooltip.css b/client/src/components/ui/Tooltip.css index a51b8842..0cff0e70 100644 --- a/client/src/components/ui/Tooltip.css +++ b/client/src/components/ui/Tooltip.css @@ -17,14 +17,14 @@ display: block; position: absolute; bottom: calc(100% + 12px); - left: calc(50% - 103px); - width: 206px; + left: 50%; padding: 10px 15px; font-size: 0.85rem; text-align: center; color: #fff; background-color: #585965; border-radius: 3px; + transform: translateX(-50%); visibility: hidden; opacity: 0; } @@ -48,3 +48,7 @@ visibility: visible; opacity: 1; } + +.tooltip-custom--narrow:before { + width: 206px; +} diff --git a/client/src/components/ui/Tooltip.js b/client/src/components/ui/Tooltip.js index 69ecfdfb..3496a0d2 100644 --- a/client/src/components/ui/Tooltip.js +++ b/client/src/components/ui/Tooltip.js @@ -4,11 +4,12 @@ import PropTypes from 'prop-types'; import './Tooltip.css'; const Tooltip = props => ( -
+
); Tooltip.propTypes = { text: PropTypes.string.isRequired, + type: PropTypes.string, }; export default Tooltip;