Giter Club home page Giter Club logo

react-image-timeline's Introduction

Hi there πŸ‘‹

My name is Aaron and I'm a product builder living in Austin. I enjoy creating things and playing disc golf. I'm currently working on something new at Blox.

Happy building!

react-image-timeline's People

Contributors

aaron9000 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

react-image-timeline's Issues

Improve Readme

  • Provide working code snippet
  • Present Typescript defs instead of tables
  • Provide a large set of sample events (same set as the demo)

Typescript definition error

The error

Here is the error message when I used the react typescript template:

TypeScript error in <root>/src/index.tsx(7,22):
File '<root>/node_modules/react-image-timeline/index.d.ts' is not a module.  TS2306

     5 | import * as serviceWorker from './serviceWorker';
     6 | 
  >  7 | import Timeline from 'react-image-timeline';

To reproduce it:

npx create-react-app my-app --template typescript
# add the following line to index.tsx file as shown in the error message
# import Timeline from 'react-image-timeline';

The workaround

If I replaced the <root>/node_modules/react-image-timeline/index.d.ts with <root>/node_modules/react-image-timeline/dist/timline.d.ts, it worked as expected.

ES6 code published to npm?

I was running into problems (related to browserify/babelify), because apparently the code was not compiled from ES6 to ES5 before publishing it to npm.

Example Project throws TypeError: Object(...) is not a function

Here is the error I run into after npm run script on the Example Project.

TypeError: Object(...) is not a function

68 | ) => {
| ^ 69 | const [imageType, setImageType] = useState('normal');
70 | const [events, setEvents] = useState(getSampleData(imageType));
71 | const [useCustomComponents, setUseCustomComponents] = useState(false);`

Is there a way to use local images?

I'm having trouble trying to use local images. Is that feasible?

This works in the img tag, but not in the events tag.

import React, { Component } from 'react';
import Timeline from 'react-image-timeline';
import thePicture from '../images/thePicture.jpg';
require('react-image-timeline/dist/timeline.css');

class Test extends Component {
  render() {
    const events = [{
      date: new Date(2013, 9, 27),
      text: "Sed leo elit, pellentesque sit amet congue quis, ornare nec lorem.",
      title: "The Picture",
      imageUrl: '../images/thePicture.jpg'
    }]

    return (
      <div className=''>
      	OurStory
        <img src={thePicture} />              {/*  Renders Picture  */}
        <Timeline events={events} />          {/*  Does Not Render Picture  */}
      </div>
    );
  }
}

export default Test;

Horizontal timeline

Hi I love this react image timeline, but can it be displayed horizontal? If not I'll be glad to help to get a horizontal versiΓ³n with your help

Regards

Issue In Default Setup

I followed a really default setup from the npm page to see how it worked, but I think there's an issue with how the date is parsed.

This simple code:

<Timeline events={[{
                date: Date.parse("2013-09-27"),
                text: "Sed leo elit, pellentesque sit amet congue quis, ornare nec lorem.",
                title: "Cairo, Egypt",
                imageUrl: "http://github.com/aaron9000/react-image-timeline/blob/master/src/assets/cairo.jpg?raw=true"
}]} />

Produces the error:

TypeError: e.getFullYear is not a function

I would suspect something is going wrong if this basic example fails.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.