-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjusted_for_recent_upstream_commits
- Loading branch information
Showing
64 changed files
with
2,017 additions
and
787 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
39 changes: 39 additions & 0 deletions
39
packages/react/src/components/Attachments/AttachmentMetadata.js
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,39 @@ | ||
import React from 'react'; | ||
import { ActionButton } from '../ActionButton'; | ||
import { Box } from '../Box'; | ||
|
||
const AttachmentMetadata = ({ attachment, url }) => { | ||
const handleDownload = () => { | ||
const anchor = document.createElement('a'); | ||
anchor.href = url; | ||
anchor.download = attachment.title; | ||
|
||
document.body.appendChild(anchor); | ||
anchor.click(); | ||
document.body.removeChild(anchor); | ||
}; | ||
|
||
return ( | ||
<> | ||
<p style={{ margin: 0 }}>{attachment.description}</p> | ||
<Box | ||
style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }} | ||
> | ||
<p style={{ margin: 0, color: 'grey' }}>{attachment.title}</p> | ||
<ActionButton | ||
ghost | ||
icon="download" | ||
size="small" | ||
onClick={handleDownload} | ||
style={{ | ||
marginLeft: '10px', | ||
marginTop: '5px', | ||
color: 'grey', | ||
}} | ||
/> | ||
</Box> | ||
</> | ||
); | ||
}; | ||
|
||
export default AttachmentMetadata; |
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
52 changes: 40 additions & 12 deletions
52
packages/react/src/components/Attachments/PinnedAttachment.js
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.