Skip to content

Unraveld a single-page e-commerce website inspired by Etsy, Ravelry and Brooklyn Tweed.

Notifications You must be signed in to change notification settings

maryhowell/Unraveled

Repository files navigation

UnRaveld

Explore UnRaveld or go to UNRAVELD.CO

UnRaveld is a single-page e-commerce website that is inspired by Etsy, Ravelry, and Brooklyn Tweed.

UnRaveld

Technologies Used

  • Ruby on Rails
  • JavaScript
  • React
  • Redux
  • PostgreSQL
  • HTML5
  • CSS3

Features and Implementation

User Authentication

UnRaveld has a custom build user authentication system. Although registering or signing in isn't required to explore the site, it's required to add patterns to your favorites and to leave a review.

Modal

Item Listings

Update

Item

Reviews

Users who have logged in can write a review of any item. You can also delete reviews that you have previously written.

Review

Below is the way a user can favorite a pattern. This code changes the value of hearted to check if a user already has 'hearted' this pattern previously. It also gives you the ability to change your mind if you want to remove it from your favorites. This will store the information in the database in a joins table.

componentWillReceiveProps(nextProps) {
  if (Object.keys(nextProps.favorites).length > 0) {
    this.hearted = true;
  } else {
    this.hearted = false;
  }
}

toggleFavorite(){
  if (this.hearted) {
    this.dislikePattern(Object.keys(this.props.favorites)[0]);
  } else {
    this.likePattern(this.props.pattern.pattern_id);
  }
}

dislikePattern(favoriteId){
  this.props.deleteFavorite(favoriteId).then(() => this.props.fetchFavorite(this.props.match.params.patternId));
}

likePattern(){
  this.props.createFavorite({
    user_id: this.props.currentUser.id,
    pattern_id: this.props.match.params.patternId
  });

}

 heart(){
  if (this.hearted) {
    return (
      <div className="heart-container">
        <div onClick={this.toggleFavorite} className="fa fa-heart-o fa-2x heart-red" name="fa-heart-o" aria-hidden='true'></div>
      </div>
    );
  } else {
    return (
      <div className="heart-container">
        <div onClick={this.toggleFavorite} className="fa fa-heart-o fa-2x heart" name="fa-heart-o" aria-hidden='true'></div>
      </div>
    );
  }
}

Future Features

  • Search Bar
  • Cart
  • Ravelrys API

About

Unraveld a single-page e-commerce website inspired by Etsy, Ravelry and Brooklyn Tweed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published