-
-
Notifications
You must be signed in to change notification settings - Fork 23
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 #602 from ZenUml/feature/share-preview-card
feat(SharePanel, PreviewCard): add author info and optimize view
- Loading branch information
Showing
10 changed files
with
662 additions
and
340 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,37 @@ | ||
import PropTypes from "prop-types"; | ||
import PropTypes from 'prop-types'; | ||
|
||
export function PreviewCard({ title, description, image }) { | ||
export function PreviewCard({ title, author, description, imageBase64 }) { | ||
return ( | ||
<div className="preview-card"> | ||
<div className="preview-card__content"> | ||
<div className="preview-card__title"> | ||
<img src="https://zenuml.cn/favicon.ico" /> | ||
<span>{title}</span> | ||
<span className="text-ellipsis">{title}</span> | ||
</div> | ||
<div className="preview-card__subtitle"> | ||
<span class="material-symbols-outlined">account_circle</span> | ||
<span className="text-ellipsis">Created by {author}</span> | ||
</div> | ||
<div className="preview-card__description"> | ||
<span>{description}</span> | ||
<p>{description}</p> | ||
</div> | ||
<div className="preview-card__footer"> | ||
<img src="https://zenuml.cn/favicon.ico" /> | ||
<span>ZenUML</span> | ||
</div> | ||
</div> | ||
<div className="preview-card__image"> | ||
<img src={image} /> | ||
<div className="overlay"> | ||
<img src={imageBase64} /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
PreviewCard.propTypes = { | ||
title: PropTypes.string.isRequired, | ||
author: PropTypes.string.isRequired, | ||
description: PropTypes.string.isRequired, | ||
image: PropTypes.string.isRequired, | ||
imageBase64: PropTypes.string, | ||
}; |
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,26 @@ | ||
import React, { Component } from 'react'; | ||
|
||
class Tooltip extends Component { | ||
state = { | ||
isTooltipVisible: false, | ||
}; | ||
|
||
handleMouseOver = () => { | ||
this.setState({ isTooltipVisible: true }); | ||
}; | ||
|
||
handleMouseOut = () => { | ||
this.setState({ isTooltipVisible: false }); | ||
}; | ||
|
||
render() { | ||
return ( | ||
<div> | ||
{this.props.children} | ||
{this.state.isTooltipVisible && ( | ||
<div className="tooltip">{this.props.children}</div> | ||
)} | ||
</div> | ||
); | ||
} | ||
} |
Oops, something went wrong.