-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from Sienci-Labs/dev
Dev
- Loading branch information
Showing
15 changed files
with
287 additions
and
23 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,37 @@ | ||
.NavLogo { | ||
margin: 0 20px 0 10px; | ||
position: relative; | ||
img { | ||
width: 40px; | ||
height: 40px; | ||
} | ||
} | ||
|
||
.updateNotification { | ||
position: absolute; | ||
display: flex; | ||
align-items center; | ||
justify-content center; | ||
bottom: -0.5rem; | ||
right: -1rem; | ||
font-size: 1.2rem; | ||
background-color: #06b881; | ||
border-radius: 9999px; | ||
width: 2rem; | ||
height: 2rem; | ||
color: #FFFFFF; | ||
animation: bounce 1s infinite; | ||
border: none; | ||
outline: none; | ||
} | ||
|
||
@keyframes bounce { | ||
0%, 100% { | ||
transform: translateY(-25%); | ||
animationTimingFunction: cubic-bezier(0.8, 0, 1, 1); | ||
} | ||
50% { | ||
transform: translateY(0); | ||
animationTimingFunction: cubic-bezier(0, 0, 0.2, 1); | ||
} | ||
} |
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
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
79 changes: 79 additions & 0 deletions
79
src/app/containers/Workspace/UpdateAvailableAlert/UpdateAvailableAlert.jsx
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,79 @@ | ||
import React, { PureComponent } from 'react'; | ||
import cx from 'classnames'; | ||
import pubsub from 'pubsub-js'; | ||
import styles from './index.styl'; | ||
|
||
|
||
class UpdateAvailableAlert extends PureComponent { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
shown: false | ||
}; | ||
} | ||
|
||
actions = { | ||
hideModal: () => { | ||
this.setState({ | ||
shown: false | ||
}); | ||
} | ||
} | ||
|
||
pubsubTokens = []; | ||
|
||
|
||
subscribe () { | ||
const tokens = [ | ||
pubsub.subscribe('showUpdateToast', (msg) => { | ||
this.setState({ | ||
shown: true | ||
}); | ||
}) | ||
]; | ||
this.pubsubTokens = this.pubsubTokens.concat(tokens); | ||
} | ||
|
||
unsubscribe () { | ||
this.pubsubTokens.forEach((token) => { | ||
pubsub.unsubscribe(token); | ||
}); | ||
this.pubsubTokens = []; | ||
} | ||
|
||
componentDidMount() { | ||
this.subscribe(); | ||
} | ||
|
||
componentWillUnmount() { | ||
this.unsubscribe(); | ||
} | ||
|
||
render() { | ||
const { shown } = this.state; | ||
const actions = { ...this.actions }; | ||
return ( | ||
<div className={cx(styles.updateWrapper, { [styles.hideModal]: !shown })}> | ||
<div className={styles.updateIcon}> | ||
<i className="fas fa-download" /> | ||
</div> | ||
<div className={styles.updateContent}> | ||
<div> | ||
Update downloaded and available to install. Restart now? | ||
</div> | ||
<button className={styles.restartButton}> | ||
Restart and Install | ||
</button> | ||
</div> | ||
<div className={styles.closeModal}> | ||
<button onClick={actions.hideModal}> | ||
<i className="fas fa-times" /> | ||
</button> | ||
</div> | ||
|
||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default UpdateAvailableAlert; |
70 changes: 70 additions & 0 deletions
70
src/app/containers/Workspace/UpdateAvailableAlert/index.styl
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,70 @@ | ||
.update-wrapper { | ||
background: #FFFFFF; | ||
font-size: 1.1rem; | ||
position: absolute; | ||
bottom: 20px; | ||
left: 20px; | ||
z-index: 10000; | ||
border-radius: 0.5rem; | ||
display: flex; | ||
flex: 1; | ||
flex-direction: row; | ||
align-items stretch; | ||
border: solid 1px #d1d5db; | ||
--tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); | ||
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); | ||
} | ||
|
||
.hideModal { | ||
display: none; | ||
} | ||
|
||
.update-icon { | ||
display: flex; | ||
flex-direction column; | ||
color: #059669; | ||
flex: 1 | ||
background: #111827; | ||
align-items center; | ||
justify-content center | ||
padding: 0 0.5rem; | ||
font-size: 2rem !important; | ||
} | ||
|
||
.update-content { | ||
display: flex; | ||
flex-direction: column; | ||
padding: 2rem; | ||
} | ||
|
||
.restartButton { | ||
background: #059669; | ||
border: solid 1px #036949; | ||
color: #FFFFFF; | ||
padding: 0.25rem; | ||
border-radius: 0.25rem; | ||
outline: none; | ||
margin-top: 0.5rem; | ||
|
||
&:hover { | ||
background: #04875e; | ||
} | ||
} | ||
|
||
.close-modal { | ||
padding: 0 0.5rem; | ||
display: flex; | ||
align-items center; | ||
justify-content center | ||
|
||
button { | ||
background: none; | ||
border: none; | ||
outline: none | ||
color: #4b5563; | ||
text-align center; | ||
i { | ||
font-size: 2rem !important; | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.