-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create document viewer component #976
base: main
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
@@ -97,7 +98,7 @@ | |||
"@emotion/cache": "~11.10.7 || ~11.11.0 || ~11.13.0", | |||
"@emotion/react": "~11.10.6 || ~11.11.0 || ~11.13.0", | |||
"@emotion/styled": "~11.10.6 || ~11.11.0 || ~11.13.0", | |||
"@graasp/sdk": "^4.14.0", | |||
"@graasp/sdk": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert.
@@ -116,7 +117,7 @@ | |||
"@emotion/cache": "~11.11.0", | |||
"@emotion/react": "11.11.4", | |||
"@emotion/styled": "11.11.5", | |||
"@graasp/sdk": "4.22.0", | |||
"@graasp/sdk": "https://github.com/graasp/graasp-sdk.git#616-docs-mimetypes", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to update.
<FileDocument uri={url} /> | ||
<DownloadButtonFileItem | ||
id={id} | ||
name={originalFileName ?? item.name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to show the item.name
name={originalFileName ?? item.name} | |
name={item.name} |
@@ -30,7 +30,7 @@ export const SizingWrapper = ({ | |||
}): JSX.Element => { | |||
const width = getWidthFromSizing(size); | |||
return ( | |||
<Box maxWidth='100%' width={width}> | |||
<Box maxWidth='100%' width={width} flex={1}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be careful here, why do you need flex=1? Add a comment, and could you please try out many different item types to be sure sizing is not broken?
gap={0.5} | ||
alignItems={alignItems} | ||
width='100%' | ||
flex={1} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
import FileDocument from './FileDocument'; | ||
|
||
const meta: Meta<typeof FileDocument> = { | ||
title: 'Items/Document File', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Document is actually what it is, but because of our other nomenclature I would prefer something a bit closer to "viewer" and to the library you used.
title: 'Items/Document File', | |
title: 'Items/FileDocumentViewer', |
type Props = { | ||
uri: string; | ||
}; | ||
const FileDocument = ({ uri }: Props): JSX.Element => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const FileDocument = ({ uri }: Props): JSX.Element => { | |
const FileDocumentViewer = ({ uri }: Props): JSX.Element => { |
|
||
export const Document: Story = { | ||
args: { | ||
uri: 'https://www.lehman.edu/faculty/john/classroomrespolicy1.docx', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just read the docs, do you think we could use a local file like this:
{ uri: require("./example-files/pdf.pdf") }, // Local File
closes #975