Skip to content
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

S3Image component ignores preview="hidden" if path prop specified #218

Closed
russelltaga opened this issue Feb 1, 2018 · 15 comments
Closed
Assignees
Labels
feature-request Request a new feature UI Related to UI Components

Comments

@russelltaga
Copy link

russelltaga commented Feb 1, 2018

When using the S3Image component, if you include the path prop like so, the component seems to ignore suppressing the preview via preview="hidden".

<S3Image level="private" preview="hidden" path="test/" fileToKey={this.fileToKey} onLoad={this.handleLoad} picker />

Here are screenshots showing how this renders:

screen shot 2018-01-31 at 10 22 39 pm

and in the JS console:

screen shot 2018-01-31 at 10 23 43 pm

If you select an image with the picker, it'll render it vs. suppressing the preview as well.

@richardzcode richardzcode added the bug Something isn't working label Feb 2, 2018
@powerful23
Copy link
Contributor

@russelltaga I think that preview props is only for PhotoPicker. I will make a pr to hide images in S3Image.

powerful23 added a commit to powerful23/aws-amplify that referenced this issue Feb 14, 2018
@russelltaga
Copy link
Author

Ugh, my bad, but thank you so much!

@powerful23
Copy link
Contributor

@russelltaga this issue has been fixed in the latest release. Please feel free to reopen the issue if neccessary.

@russelltaga
Copy link
Author

@powerful23 Thank you much!

@russelltaga
Copy link
Author

@powerful23 Sorry to bother you about this, but one side effect with the hidden image, is that I'm not seeing a way to know when the file has been uploaded. The onLoad event understandably doesn't fire since you're no longer loading the image to preview it. Are there any other hooks that I overlooked by chance when using S3Image?

@powerful23
Copy link
Contributor

@russelltaga we will look into that.

@powerful23 powerful23 reopened this Feb 23, 2018
@powerful23 powerful23 added enhancement and removed bug Something isn't working labels Mar 16, 2018
@mlabieniec mlabieniec added the feature-request Request a new feature label Apr 2, 2018
@mlabieniec mlabieniec added this to the aws-amplify@0.5 milestone Apr 13, 2018
@mlabieniec mlabieniec removed this from the aws-amplify@0.5 milestone Jul 19, 2018
@jordanranz jordanranz added the UI Related to UI Components label Sep 26, 2018
@jordanranz jordanranz self-assigned this Sep 26, 2018
@hernangarcia
Copy link

Hello @russelltaga , can you please share a sample about using the component? I am getting weird display when using it.

This is my code:
<S3Image imgKey={username + '_profile_img'} picker />

And you can see in the image what I get.
screenshot 2018-09-28 11 32 24

@russelltaga
Copy link
Author

@hernangarcia Over time some of the requirements we had at the time shifted and I ended up implementing a custom UI and using the Storage APIs directly. It's been many months and a little tied up right now, but will try to whip up an example next week.

@russelltaga
Copy link
Author

@hernangarcia Here's a sample component. I'm not seeing anything funky with a bare bones component.

With preview

screen shot 2018-10-01 at 8 19 24 am

import React, { Component } from 'react';
import { S3Image } from 'aws-amplify-react';
import { Container, Header } from 'semantic-ui-react';

class Sample extends Component {

    render() {
        const key = 'test';
        return (
            <Container textAlign="center">
                <Header as="h1" content="Sample S3Image component" />
                <S3Image imgKey={key} picker />
            </Container>
        );
    }

}

export default Sample;

With preview suppressed

screen shot 2018-10-01 at 8 21 47 am

import React, { Component } from 'react';
import { S3Image } from 'aws-amplify-react';
import { Container, Header } from 'semantic-ui-react';

class Sample extends Component {

    render() {
        const key = 'test';
        return (
            <Container textAlign="center">
                <Header as="h1" content="Sample S3Image component" />
                <S3Image imgKey={key} picker hidden />
            </Container>
        );
    }

}

export default Sample;

@ceich
Copy link
Contributor

ceich commented Oct 21, 2018

@russelltaga are you looking at the 2.1.x version of aws-amplify-react? I just upgraded today and see what @hernangarcia is seeing.

@russelltaga
Copy link
Author

@ceich My bad, I'm definitely on an older version (completely forgot to upgrade to the latest for the test). Will try to verify soon.

@russelltaga
Copy link
Author

With aws-amplify-react 2.1.1 I get this when using the picker (<S3Image imgKey={key} picker />).

screen shot 2018-10-21 at 9 19 39 pm

and get a blank component if the hidden prop is added (<S3Image imgKey={key} picker hidden />).

screen shot 2018-10-21 at 9 25 15 pm

@jordanranz
Copy link
Contributor

FYI, we have started an RFC discussion for a proposed Amplify UI Component refactor to increase customizability and flexibility for our components. Please feel free to add any additional comments to the following issue:

#3279

@sammartinez
Copy link
Contributor

Looking at responses from @russelltaga I do see that he was able to resolve this other ways and there are other FRs open for similar things, as referenced above. I am going to resolve this feature request. Please feel free to make comments on the RFC if there are further callouts.

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request a new feature UI Related to UI Components
Projects
None yet
Development

No branches or pull requests

9 participants