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

Fallback text or component for unsupported browsers #4

Open
bjrmatos opened this issue Apr 5, 2015 · 3 comments
Open

Fallback text or component for unsupported browsers #4

bjrmatos opened this issue Apr 5, 2015 · 3 comments

Comments

@bjrmatos
Copy link

bjrmatos commented Apr 5, 2015

i think it would be good to provide some way to specify what to show when animations are not supported, maybe as a new prop or some child passed to the component

prop:

var Loader = require('halogen/PulseLoader');
var Example = React.createClass({
    render: function() {
        var fallbackContent = 'Loading...' // or <span><b>Loading...</b></span>

        return (
            <Loader color="#26A65B" size="16px" margin="4px" fallbackContent={fallbackContent} />
        );
    }
});

or

var Loader = require('halogen/PulseLoader');
var Example = React.createClass({
    render: function() {
        return (
            <Loader color="#26A65B" size="16px" margin="4px">
              <span><b>Loading...</b></span> // or 'Loading...'
            <Loader/>
        );
    }
});

the mechanism to determine whether this fallback content should be shown could be specified as a new prop.

var fallback = !Modernizr.cssanimations;

var Loader = require('halogen/PulseLoader');
var Example = React.createClass({
    render: function() {
        return (
            <Loader color="#26A65B" size="16px" margin="4px" fallback={fallback} >
              <span><b>Loading...</b></span> // or 'Loading...'
            <Loader/>
        );
    }
});
@yuanyan
Copy link
Owner

yuanyan commented Apr 6, 2015

Good idea, i will have a try.

@chiedo
Copy link

chiedo commented Sep 23, 2015

Any progress on the fallback? You can use bowser (https://www.npmjs.com/package/bowser) to do so

@diffractometer
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants