npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-noticesbar

v0.0.5

Published

react-native竖向滚动通知栏(公告栏)

Downloads

17

Readme

react-native-noticesbar gitHub链接

react-native-noticesbar

react-native竖向滚动通知栏(公告栏)

install 使用

$ npm install react-native-noticesbar
$ yarn add react-native-noticesbar

use 使用

es5


const NoticesBar = require('react-native-noticesbar')

es6


import NoticesBar from 'react-native-noticesbar'

示例:

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View, SafeAreaView } from 'react-native';
import NoticesBar from './react-native-noticesbar'

const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
  android:
    'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});

type Props = {};
export default class App extends Component<Props> {
  state = {
    data: [
      {
        name: '这是一个很长很长的标题这是一个很长很长的标题这是一个很长很长的标题这是一个很长很长的标题这是一个很长很长的标题',
      },
      {
        name: '这是一个很长很长的标题这是一个很长很长的标题这是一个很长很长的标题',
      },
      {
        name: '这是一个很长很长的标题2这是一个很长很长的标题2',
      },
      {
        name: '这是一个很长很长的标题3这是一个很长很长的标题3这是一个很长很长的标题3',
      },
    ]
  }
  render() {
    const { data } = this.state
    //icon: 如果没有icon 不填或者null即可 React.Element格式
    //showFieldName: 主要作用于json字段显示用 因为每个项目各不同,有的系统是title,有的系统是name 为了方便 直接定义出来设置
    return (
      <SafeAreaView>
        <View style={{ height: 40,borderColor: 'red',borderBottomWidth: 1,borderTopWidth: 1 }}>
          <NoticesBar
            icon={<Text style={[GlobalStyles.color1175e0, { position:'absolute',lineHeight: 40, width: 40}]}/>}
            //如果有icon则建议调整定位功能使用
            showFieldName="name"
            onPress={item => {
              //事件
            }}
            enableAnimation={true}
            data={data}
            delay={2500}
            duration={1000}
            scrollHeight={40}
            scrollStyle={{ alignItems: 'flex-start' }}
            textStyle={{ color: '#a1a7b9', fontSize: 13 }}
            paddingLeft={40}
            //增加图标宽度字段使用
          />
        </View>
      </SafeAreaView>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

update

v0.0.1

1、组件上传

v0.0.2

1、调整一些bug,

v0.0.3

1、调整组件内所有样式,
2、增加padding位置,如果无icon是可不用, 有icon是设置icon宽度即可,或者自己根据需求修改
3、增加proptypes检验字段类型

v0.0.4

1、删除错误引用包
2、删除无用文件

演示图

MIT

如果问题请联系 [email protected]