From b0157042154a1640d2449c724ab7c6a92cc627a4 Mon Sep 17 00:00:00 2001
From: jpsc
Date: Mon, 25 Jun 2018 16:47:39 +0200
Subject: [PATCH] fix(anchors): move anchors to buttons when more appropriate
---
src/components/Footer.jsx | 68 +++++++++++++++-----------------
src/components/MainHeader.jsx | 30 +++++++-------
src/components/Modal.jsx | 2 +-
src/components/Notifications.jsx | 6 +--
src/components/common.jsx | 4 --
src/style.css | 28 ++++++++++---
6 files changed, 73 insertions(+), 65 deletions(-)
diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx
index dee0ff8..60191f6 100644
--- a/src/components/Footer.jsx
+++ b/src/components/Footer.jsx
@@ -1,5 +1,5 @@
import { h, Component } from 'preact';
-import { A } from './common';
+import { Button } from './common';
export default class Footer extends Component {
constructor(props) {
@@ -15,8 +15,8 @@ export default class Footer extends Component {
render() {
return (
);
}
diff --git a/src/components/MainHeader.jsx b/src/components/MainHeader.jsx
index 7b2b102..ec09ef3 100644
--- a/src/components/MainHeader.jsx
+++ b/src/components/MainHeader.jsx
@@ -1,5 +1,5 @@
import { h } from 'preact';
-import { A } from './common';
+import { Button } from './common';
const DEFAULT_PROFILE_IMG =
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='#ccc' d='M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z' /%3E%3C/svg%3E";
@@ -16,7 +16,7 @@ export function MainHeader(props) {
onBlur={props.titleInputBlurHandler}
/>
);
diff --git a/src/components/Modal.jsx b/src/components/Modal.jsx
index b4e93d4..ea2ccf1 100644
--- a/src/components/Modal.jsx
+++ b/src/components/Modal.jsx
@@ -66,7 +66,7 @@ export default class Modal extends Component {
onClick={this.props.closeHandler}
aria-label="Close modal"
title="Close"
- class="js-modal__close-btn modal__close-btn"
+ class="js-modal__close-btn modal__close-btn"
>
Close
diff --git a/src/components/Notifications.jsx b/src/components/Notifications.jsx
index ecef3d4..3d50199 100644
--- a/src/components/Notifications.jsx
+++ b/src/components/Notifications.jsx
@@ -1,5 +1,5 @@
import { h } from 'preact';
-import { A } from './common';
+import { Button } from './common';
function NotificationItem({ type, children }) {
var strongTag;
@@ -81,7 +81,7 @@ function Notification({ version, isLatest, ...props }) {
>
Share it
-
Support the developer
-
+
) : null}
diff --git a/src/components/common.jsx b/src/components/common.jsx
index 5cbb6ba..f358171 100644
--- a/src/components/common.jsx
+++ b/src/components/common.jsx
@@ -19,10 +19,6 @@ class Clickable extends Component {
}
}
-export function A(props) {
- return ;
-}
-
export function Button(props) {
return ;
}
diff --git a/src/style.css b/src/style.css
index 611db3d..a02c8d5 100644
--- a/src/style.css
+++ b/src/style.css
@@ -33,6 +33,15 @@ p {
line-height: 1.65;
}
+button {
+ background-color: transparent;
+ border: 0;
+ font-family: inherit;
+ font-size: 100%;
+ outline: 0;
+ padding: 0;
+}
+
.hide {
display: none !important;
}
@@ -125,6 +134,10 @@ p {
margin-top: 0;
}
+.support-link {
+ color: #d61237;
+}
+
@media screen and (max-width: 600px) {
.block--mobile {
display: block;
@@ -575,7 +588,7 @@ body > #demo-frame {
border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
-.main-header__btn-wrap > a {
+.main-header__btn-wrap > button {
font-size: 0.8em;
font-weight: bold;
line-height: 20px;
@@ -597,7 +610,7 @@ body > #demo-frame {
text-transform: uppercase;
}
-.main-header__btn-wrap > a > svg {
+.main-header__btn-wrap > button > svg {
fill: #9297b3;
margin-right: 4px;
}
@@ -669,12 +682,12 @@ body > #demo-frame {
top: 2px;
}
-.footer a > svg {
+.footer button > svg {
transition: 0.3s ease;
fill: rgba(255, 255, 255, 0.2);
}
-.footer a:hover svg {
+.footer button:hover svg {
fill: rgba(255, 255, 255, 0.45);
}
@@ -745,12 +758,15 @@ body > #demo-frame {
.modal__close-btn {
position: absolute;
- right: 10px;
- top: 10px;
+ right: 1rem;
+ top: 1rem;
text-transform: uppercase;
font-weight: 700;
opacity: 0.8;
transition: 0.25s ease;
+ border: 1px solid black;
+ border-radius: 2px;
+ padding: 0.2rem 0.5rem;
}
.modal__close-btn > svg {