-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
11102f7
commit 54968f6
Showing
5 changed files
with
49 additions
and
14 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.MenuBarContainer { | ||
display: flex; | ||
flex-direction: row-reverse; | ||
border-bottom: solid 1px #606993; | ||
height: 30px; | ||
} | ||
|
||
button { | ||
border-radius: 5px; | ||
margin-right: 5px; | ||
font-weight: bolder; | ||
margin: 2px; | ||
} |
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,33 @@ | ||
import React, { Component } from 'react' | ||
|
||
import ThemeManager from '../../lib/ThemeManager' | ||
import DocumentManager from '../../model/DocumentManager' | ||
|
||
import './MenuBar.css' | ||
|
||
const theme = ThemeManager.getInstance() | ||
const documents = DocumentManager.getInstance() | ||
|
||
class MenuBar extends Component { | ||
render() { | ||
return ( | ||
<div className="MenuBarContainer"> | ||
<button style={theme.getColorStyles()} onClick={this.download}> | ||
Download | ||
</button> | ||
</div> | ||
) | ||
} | ||
|
||
download() { | ||
let element = document.createElement('a') | ||
element.setAttribute( | ||
'href', | ||
'data:text/text;charset=utf-8,' + encodeURI(documents.activeNote.text) | ||
) | ||
element.setAttribute('download', documents.activeNote.downloadName) | ||
element.click() | ||
} | ||
} | ||
|
||
export default MenuBar |
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