Giter VIP home page Giter VIP logo

reapop-theme-wybo's Introduction

reapop-theme-wybo

โš ๏ธ This package is deprecated because this theme is now directly included in the lastest version of reapop package.

npm version npm dependencies npm download/month gitter chat

Official theme for Reapop

Compatibility

Tested and works with Reapop v0.6.0 or later in :

Supported browsers

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
IE10, IE11, Edge last 2 versions last 2 versions last 2 versions last 2 versions

Installation

npm install reapop-theme-wybo --save

Integration

Update webpack config

You have to define some loaders to handle files of theme. If it's not already the case, you need to install :

  • style-loader with npm install style-loader --save-dev
  • css-loader with npm install css-loader --save-dev
  • url-loader with npm install url-loader --save-dev
  • file-loader with npm install file-loader --save-dev

Look at this example, you can use it in for your project. Check out configuration of Reapop Demo to see a complete example.

// CSS loader with some configuration
// read https://github.com/webpack/css-loader to understand each query parameters
var CSSLoader = [
  'css-loader?sourceMap&-minimize',
  'modules',
  'importLoaders=1',
  'localIdentName=[name]__[local]__[hash:base64:5]'
].join('&');

module.exports = {
  module: {
    loaders: [{
      test: /\.css$/,
      loaders: ['style-loader', CSSLoader]
    }, {
      test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
      loader: "url-loader?limit=10000&minetype=application/font-woff"
    }, {
      test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
      loader: "file-loader"
    }]
  }
};

Install Font Awesome

This theme doesn't include Font Awesome to let you install it the way you want:

With Webpack

  1. Install Font Awesome with npm install font-awesome --save

and import it in your app. Example :

import '!style-loader!css-loader!font-awesome/css/font-awesome.min.css';

With BootstrapCDN

Add this line in <head> of your main index.html file :

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">

Set the theme

import React, {Component} from 'react';
import NotificationsSystem from 'reapop';
// 1. import Font Awesome
import '!style-loader!css-loader!font-awesome/css/font-awesome.min.css';
// 2. import reapop theme
import theme from 'reapop-theme-wybo';

class ATopLevelComponent extends Component {
  render() {
   // 3. set `theme` prop
    return (
      <div>
        <NotificationsSystem theme={theme}/>
      </div>
    );
  }
}

Customize the theme

Follow this guide : Reapop - Customize or create a theme

License

Reapop-theme-wybo is under MIT License

reapop-theme-wybo's People

Contributors

ingro avatar joerodrig avatar louisbarranqueiro avatar renovate-bot avatar renovate[bot] avatar zackify avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

reapop-theme-wybo's Issues

Peer dependency bug with npm

When trying to install this theme with reapop ^1.0.0. Got the following message:
npm ERR! peerinvalid The package reapop does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer [email protected] wants reapop@^0.6.0

Do you know how to fix that ? And why this theme as a peer outdated peer dependency ?

Broken UI on Small Devices with 2 Buttons

When a notification should have two buttons the UI is broken on small devices. The second button "wraps" to the next line which is not visible. This means that any notification in which a user should be able to select one of two options instead only sees one option. This make the library unusable on mobile devices when needing to allow users multiple options. Moreover, I use a "Cancel" button so that a user could decide not to do an action, and when the UI breaks in this way, a user cannot even dismiss the notification because "dismissible" has no effect.

screen shot 2017-04-04 at 9 52 07 am
screen shot 2017-04-04 at 9 51 35 am

Provide a css-only version

Hello! I'm trying to use reapop in my latest react-redux application but I can't use the provided themes because they require sass-loader and since I'm using CRA (which is becoming increasingly popular) I have no way to add that loader, and in general I think that should be preferable to provide a standard css version because it would be more compatible with the various build pipeline that devs are using.

What do you think about it? The css version should be the default one or just an alternative? Maybe I can try to put up a PR for this issue but I would like to know your opinion first.

Thank you.

The css variable has additional 'default' prop.

Description

Hi I have recently migrate my project to works on:
"webpack": "5.4.0",
"webpack-cli": "3.3.12"
"style-loader": "2.0.0",
"css-loader": "5.0.1",
"@babel/core": "7.12.3",
"@babel/polyfill": "7.12.1",
"@babel/preset-env": "7.12.1",
"@babel/preset-react": "7.12.5",

In the moment everything works fine except the "reapop-theme-wybo", the theme itself comes with classNames of "undefined".

Explanation / motivation

I have checked the "reapop-theme-wybo/index.js" file and found out that the constant named "css" have a propperty called 'default' which contains all the classes. For example if I add everywhere css.default['some-class-name'] instead of css['some-class-name'] it works without issues.

When I try the approach to do something like this, for example -> const { default: css } = require('./lib/styles.module.css');
It works without any issues.
image
image

So, If you have time, could you check this and if possible to add it into a future update, please.

The interesting part is that on :
"webpack": "4.44.1",
"webpack-cli": "3.3.12",
"style-loader": "1.2.1",
"css-loader": "4.1.1",
"@babel/core": "7.11.0",
"@babel/polyfill": "7.10.4",
"@babel/preset-env": "7.11.0",
"@babel/preset-react": "7.10.4",

It is working fine.
image

Additional information

I will add some screenshots to make it easier for getting all I said.

Here is how it looks like:

image

image

And here is example of what I mean:
image

image

Errors "Module not found: Error: Can't resolve ..." in webpack config

Hi !
Just spent half an hour figuring out why the webpack config given in the docs produced several errors like :

./~/reapop-theme-wybo/index.js
Module not found: Error: Can't resolve 'css' 

It's just that newer versions of webpack require the "-loader" to be appended to the module name

So if there are people not very familiar to webpack like me, here's my working config :

var CSSLoader = [
  'css-loader?sourceMap&-minimize',
  'modules',
  'importLoaders=1',
  'localIdentName=[name]__[local]__[hash:base64:5]'
].join('&');

module.exports = {
  module: {
    loaders: [{
      test: /\.css$/,
      loaders: ['style-loader', CSSLoader]
    }, {
      test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
      loader: "url-loader?limit=10000&minetype=application/font-woff"
    }, {
      test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
      loader: "file-loader"
    }]
  }
};

Except that, everything is working great so far :)

why is font awesome a dependency ?

It seems to work fine without it. I'm already using Materialui icons in my project. are there certain icons you are specifically using from font-awesome?

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.