-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Desktop: Add ability to share a note publicly using Nextcloud (#2173)
* Moved button row to separate component file and started Sharing dialog * Adding Sharing dialog * Applied "npx react-codemod rename-unsafe-lifecycles" * More UI * Tools: Improved TypeScript integration * Improved share dialog * Tools Added support for translation validation in CI, and added support for plural translations * Improved UI and sharing workflow * Share workflow * Cleaned up and improved sharing config error handling * Fixed build scripts and doc for TypeScript * Run linter
- Loading branch information
Showing
39 changed files
with
988 additions
and
159 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
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
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,45 @@ | ||
const React = require('react'); | ||
const { _ } = require('lib/locale.js'); | ||
const { themeStyle } = require('../theme.js'); | ||
|
||
function DialogButtonRow(props) { | ||
const theme = themeStyle(props.theme); | ||
|
||
const okButton_click = () => { | ||
if (props.onClick) props.onClick({ buttonName: 'ok' }); | ||
}; | ||
|
||
const cancelButton_click = () => { | ||
if (props.onClick) props.onClick({ buttonName: 'cancel' }); | ||
}; | ||
|
||
const onKeyDown = (event) => { | ||
if (event.keyCode === 13) { | ||
okButton_click(); | ||
} else if (event.keyCode === 27) { | ||
cancelButton_click(); | ||
} | ||
}; | ||
|
||
const buttonComps = []; | ||
|
||
if (props.okButtonShow !== false) { | ||
buttonComps.push( | ||
<button key="ok" style={theme.buttonStyle} onClick={okButton_click} ref={props.okButtonRef} onKeyDown={onKeyDown}> | ||
{_('OK')} | ||
</button> | ||
); | ||
} | ||
|
||
if (props.cancelButtonShow !== false) { | ||
buttonComps.push( | ||
<button key="cancel" style={Object.assign({}, theme.buttonStyle, { marginLeft: 10 })} onClick={cancelButton_click}> | ||
{props.cancelButtonLabel ? props.cancelButtonLabel : _('Cancel')} | ||
</button> | ||
); | ||
} | ||
|
||
return <div style={{ textAlign: 'right', marginTop: 10 }}>{buttonComps}</div>; | ||
} | ||
|
||
module.exports = DialogButtonRow; |
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
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.