File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
src/app/pages/Sandbox/Editor/Content/Header Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,11 @@ const ActionLink = styled(Link)`
5555 text-decoration: none;
5656` ;
5757
58+ const ActionA = styled . a `
59+ ${ styles }
60+ text-decoration: none;
61+ ` ;
62+
5863const ActionTooltip = styled ( Tooltip ) `
5964 ${ styles }
6065 ${ props => props . disabledAction && `
@@ -71,7 +76,7 @@ const IconContainer = styled.div`
7176 display: flex;
7277 alignItems: center;
7378 height: 100%;
74- padding: 0 .75rem;;
79+ padding: 0 .75rem;
7580` ;
7681
7782type Props = {
@@ -84,6 +89,7 @@ type Props = {
8489 tooltip : ?string ,
8590 moreInfo : ?boolean ,
8691 unresponsive : boolean ,
92+ a : ?boolean ,
8793} ;
8894
8995export default ( {
@@ -96,6 +102,7 @@ export default ({
96102 placeholder,
97103 moreInfo,
98104 unresponsive,
105+ a,
99106} : Props ) => {
100107 if ( ! href && ( placeholder || tooltip ) ) {
101108 return (
@@ -126,6 +133,21 @@ export default ({
126133 ) ;
127134 }
128135
136+ if ( href && a && ( placeholder || tooltip ) ) {
137+ return (
138+ < ActionA href = { href } target = "_blank" rel = "noopener noreferrer" >
139+ < Tooltip title = { placeholder || tooltip } >
140+ < IconContainer >
141+ < Icon />
142+ { title !== undefined &&
143+ < Title unresponsive = { unresponsive } > { title } </ Title > }
144+ { moreInfo && < MoreInfoIcon style = { { fontSize : '1.1rem' } } /> }
145+ </ IconContainer >
146+ </ Tooltip >
147+ </ ActionA >
148+ ) ;
149+ }
150+
129151 if ( href && ( placeholder || tooltip ) ) {
130152 return (
131153 < ActionLink to = { href } >
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import GithubIcon from 'react-icons/lib/go/mark-github';
99import ChevronLeft from 'react-icons/lib/md/chevron-left' ;
1010import HeartIcon from 'react-icons/lib/fa/heart-o' ;
1111import FullHeartIcon from 'react-icons/lib/fa/heart' ;
12+ import TwitterIcon from 'react-icons/lib/fa/twitter' ;
1213import { Tooltip } from 'react-tippy' ;
1314
1415import type { Sandbox , CurrentUser } from 'common/types' ;
@@ -184,6 +185,12 @@ export default class Header extends React.PureComponent {
184185 </ Left >
185186
186187 < Right >
188+ < Action
189+ href = "https://twitter.com/ives13"
190+ a
191+ tooltip = "Message me"
192+ Icon = { TwitterIcon }
193+ />
187194 < FeedbackView
188195 email = { user . email }
189196 sendMessage = { userActions . sendFeedback }
You can’t perform that action at this time.
0 commit comments