Skip to content

Commit

Permalink
Feature share (#504)
Browse files Browse the repository at this point in the history
* #493: As a user, I want to share the diagram so that they can collaborate with me
1. when user click the button, browser will open a new window show the github survey page
2. regarding the implements:
2.1 I have to add an empty function for the share button, I don't know how to avoid that
2.2 I might need to change the share button position

* Add tract event for share survey

Co-authored-by: hanzhenfeng <[email protected]>
  • Loading branch information
Simon-zhenfeng and hanzhenfeng authored Oct 20, 2022
1 parent 6edc269 commit d45897b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/components/ContentWrap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ export default class ContentWrap extends Component {
trackEvent('ui', 'downloadJpeg');
}

shareClickHandler(e) {
trackEvent('ui', 'shareSurvey');
}

async resetSplitting() {
await this.setState({
codeSplitSizes: this.getCodeSplitSizes(),
Expand Down Expand Up @@ -765,8 +769,6 @@ export default class ContentWrap extends Component {
this.cm.js.setValue(codeService.addCode(code, param));
}

gotoShareSurvey() {}

render() {
return (
<SplitPane
Expand Down Expand Up @@ -1003,13 +1005,13 @@ export default class ContentWrap extends Component {
<div class="demo-side" id="js-demo-side" style="overflow-y: auto; -webkit-overflow-scrolling: touch;">
{window.zenumlDesktop ? (null) : (
<div className='promotion'>
<div className="downloads">
<div className="actions">
<a href='https://github.com/ZenUml/web-sequence/discussions/496' target="_blank"
style={{textDecoration:'none'}}>
<Button
className="btn--dark button icon-button hint--rounded hint--bottom-left"
aria-label="Share Your Work"
onClick={this.gotoShareSurvey.bind()}>
onClick={this.shareClickHandler.bind(this)}>
<span className="material-symbols-outlined">share</span>
<span>Share</span>
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ body:not(.light-version).overlay-visible .main-container {
font-weight: lighter;
}

.demo-side .promotion .downloads {
.demo-side .promotion .actions {
margin-left: auto;
display: flex;
align-items: center;
Expand Down

0 comments on commit d45897b

Please sign in to comment.