-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nicola Parrello
committed
Apr 3, 2019
1 parent
a29cafa
commit 9dbc1d8
Showing
12 changed files
with
274 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
REACT_APP_GOOGLE_TAG_MANAGER_CONTAINER_ID=GTM-XXXXXX | ||
|
||
NODE_PATH=src/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/plugins/BunqLayoutPlugin/components/Floater/Floater.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import React from "react"; | ||
import { library, dom } from "@fortawesome/fontawesome-svg-core"; | ||
import { | ||
faGithub, | ||
faStackOverflow | ||
} from "@fortawesome/free-brands-svg-icons"; | ||
|
||
import { iconTogether } from "helpers/bunqIcons"; | ||
|
||
/** | ||
* @author Nicola Parrello <[email protected]> | ||
* @since 20190402 Initial creation. | ||
*/ | ||
class Floater extends React.Component { | ||
/** | ||
* @type {Object[]} | ||
*/ | ||
static allResource = [ | ||
{ | ||
destination: "https://github.com/bunq", | ||
name: "GitHub", | ||
icon: "github" | ||
}, | ||
{ | ||
destination: "https://stackoverflow.com/search?q=bunq", | ||
name: "Stack Overflow", | ||
icon: "stack-overflow" | ||
}, | ||
{ | ||
destination: "https://together.bunq.com/t/api", | ||
name: "bunq Together", | ||
icon: "together" | ||
} | ||
]; | ||
|
||
/** | ||
* @param {Object} props | ||
*/ | ||
constructor (props: Object) { | ||
super(props); | ||
|
||
library.add([ | ||
faGithub, | ||
faStackOverflow, | ||
iconTogether | ||
]); | ||
|
||
dom.watch(); | ||
} | ||
|
||
/** | ||
* @returns {Node} | ||
*/ | ||
render (): Node { | ||
const { getComponent } = this.props; | ||
const FloaterItem = getComponent("FloaterItem", true); | ||
|
||
return ( | ||
<div className="floater"> | ||
<div className="floater-list"> | ||
{ | ||
Floater.allResource.map((resource: Object, index: number): Element => { | ||
return ( | ||
<FloaterItem key={ index } resource={ resource } /> | ||
); | ||
}) | ||
} | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Floater; |
44 changes: 44 additions & 0 deletions
44
src/plugins/BunqLayoutPlugin/components/FloaterItem/FloaterItem.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from "react"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
|
||
/** | ||
* @author Nicola Parrello <[email protected]> | ||
* @since 20190403 Initial creation. | ||
*/ | ||
class FloaterItem extends React.Component { | ||
/** | ||
* @param {Object} props | ||
*/ | ||
constructor (props: Object) { | ||
super(props); | ||
|
||
const { resource } = props; | ||
|
||
this.state = { | ||
destination: resource.destination, | ||
name: resource.name, | ||
icon: resource.icon | ||
}; | ||
} | ||
|
||
/** | ||
* @returns {Node} | ||
*/ | ||
render (): Node { | ||
return ( | ||
<div className={ "floater-item" }> | ||
<a href={ this.state.destination } target={ "_blank" }> | ||
<FontAwesomeIcon | ||
icon={ | ||
["fab", this.state.icon] | ||
} | ||
title={ this.state.name } | ||
size={ "3x" } | ||
/> | ||
</a> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default FloaterItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@import "variables"; | ||
|
||
$border-radius-floater: 8px; | ||
|
||
.floater { | ||
position: fixed; | ||
top: 25%; | ||
right: 0; | ||
display: none; | ||
border-top-left-radius: $border-radius-floater; | ||
border-bottom-left-radius: $border-radius-floater; | ||
background-color: $color-grey-dark; | ||
|
||
@media (min-width: $width-viewport-small) { | ||
display: flex; | ||
} | ||
|
||
.floater-list { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
padding-left: 0; | ||
margin: $spacer-small; | ||
list-style: none; | ||
|
||
.floater-item { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin-bottom: $spacer-medium; | ||
|
||
&:last-of-type { | ||
margin-bottom: 0; | ||
} | ||
|
||
a { | ||
color: $color-white; | ||
font-size: $font-size-sidebar-item; | ||
text-decoration: none; | ||
|
||
&:hover { | ||
text-decoration: underline; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.