1.0.3 • Published 3 years ago

react-native-modal-progress-bar v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Modal Progressbar Js Code - Support Android and IOS

  • 60FPS
  • js Code

Installation

  • Step 1: first you can install lib "react-native-modal":
yarn add react-native-modal
  • Step 2:
yarn add react-native-modal-progress-bar

Usage

import React, { useEffect, useState } from 'react';
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import ModalProcess from 'react-native-modal-progress-bar';
import useInterval from './useInterval';

const App = () => {
  const [percent, setPercent] = useState<number>(0);
  const [isShowModal, setShowModal] = useState<boolean>(false);

  const onAddPercent = () => {
    setPercent(percent + 2);
  };

  useEffect(() => {
    if (percent > 0 && isShowModal === false) {
      setShowModal(true);
    }
  }, [percent]);

  useInterval(() => {
    onAddPercent();
  }, percent > 0 && percent < 100 ? 2000 : null);

  return (
    <View style={{ justifyContent: 'center', flex: 1, marginHorizontal: 14 }}>
      <Text>
        Hello
      </Text>
      <TouchableOpacity style={styles.btn} onPress={onAddPercent}>
        <Text style={styles.txtWhite}>Add percent</Text>
      </TouchableOpacity>

      <ModalProcess
        isVisible={isShowModal}
        percent={percent}
        hiddenModal={() => setShowModal(false)}
        title={'Device is update!'}
        subTitle={'Please stay connected to the device!!!'} />

    </View>
  );
};

const styles = StyleSheet.create({
  btn: {
    backgroundColor: 'brown',
    justifyContent: 'center',
    paddingVertical: 12,
    alignItems: 'center',
    width: '60%',
    alignSelf: 'center',
    marginVertical: 20,
    borderRadius: 11,
  },
  txtWhite: { color: 'white', fontWeight: 'bold' },

});

export default App;

Properties

interface ModalProcessProps {
  wrapProcess: ViewStyle;
  onBackdropPress?: () => void;
  subTitleStyle?: TextStyle;
  styleTitle?: TextStyle;
  styleModal?: ViewStyle;
  hiddenModal?: () => void;
  isVisible: boolean;
  setVisible?: (isShowModal: boolean) => void;
  percent: number;
  heightProgressbar?: number;
  colorBg?: string;
  colorProcess?: string;
  backgroundColorModal?: string;
  backdropColor?: string;
  title: string;
  subTitle?: string;
  propsModal?: ModalProps;
  styleWrapContentModal?: ViewStyle;
}

declare const ModalProcess: (props: ModalProcessProps) => JSX.Element;
export default ModalProcess;

Demo

npm.io

License

MIT

abababort-controllerabsolute-pathacornacorn-jsxacceptsJSONStreamaggregate-errorajvadd-streamacorn-globalsanseracorn-walkansi-alignansi-escapesansi-colorsansi-cyanansi-regexansi-stylesansi-fragmentsanymatchansi-redarr-diffarr-flattenarr-unionansi-grayansi-wraparray-find-indexarray-includesargparsearray-filterarray-maparray-unionarray.prototype.flatmaparray-uniqueasaparray-ifyarray-reduceassign-symbolsastral-regexasn1array-slicearrifyat-least-nodeasyncatobasync-retrybabel-jestbabel-plugin-dynamic-import-nodebabel-plugin-istanbulbabel-eslintbabel-plugin-polyfill-corejs2babel-plugin-jest-hoistasynckitbabel-plugin-polyfill-corejs3babel-plugin-polyfill-regeneratoraws4babel-preset-jestbabel-preset-current-node-syntaxbalanced-matchbaseaws-sign2babel-plugin-syntax-trailing-function-commasbabel-preset-fbjsbase64-jsbcrypt-pbkdfblbefore-after-hookbig-integerbracesboxenbrowserslistbrace-expansionbserbplist-parserbplist-creatorbuffer-frombuiltinscache-basecacheable-requestcall-bindcaller-callsitebrowser-process-hrtimebuffer-crc32caller-pathcallsitescamelcasebuffercaniuse-litebytescacheable-lookupchalkchar-regexcamelcase-keysci-infocaselesscapture-exitclass-utilschardetclean-stackbindingscjs-module-lexercli-spinnerscli-boxescli-cursorclone-responsecocli-widthassert-pluscollection-visitcolor-namecolor-convertcliuiclonecollect-v8-coveragecommandercolor-supportcolorettecomponent-emittercommondircompare-funcconcat-mapcompressiblecompare-versionscompressionconcat-streamconfigstoreconnectconventional-changelog-angularconventional-changelogconventional-changelog-codemirrorconventional-changelog-coreconventional-changelog-atomconventional-changelog-conventionalcommitsconventional-changelog-emberconventional-changelog-jqueryconventional-changelog-eslintconventional-changelog-expressconventional-changelog-jshintconventional-changelog-preset-loaderconventional-commits-filterconventional-recommended-bumpconvert-source-mapcopy-descriptorcore-js-compatcosmiconfigcross-spawnconventional-commits-parsercore-jscsstypecore-util-iscrypto-random-stringcssomdashdashcssstyledata-urlscurrently-unhandledcommand-existsdebugcombined-streamdecamelizedargsdateformatdecode-uri-componentdecompress-responsedayjsdedentdeep-isdecamelize-keysdecimal.jsdefer-to-connectdefine-propertiesdefine-propertydeldeep-extenddefaultsdelayed-streamdenodeifydepddetect-newlinediff-sequencesdir-globdoctrinedeprecationdestroyduplexer3deprecated-objecc-jsbnejselectron-to-chromiumemitteryemoji-regexdot-propdomexceptionend-of-streamee-firstencodeurlerror-exencodingenvinfoes-abstractes-to-primitiveenquirerescaladeerror-stack-parserescape-string-regexperrorhandlereslint-plugin-eslint-commentseslint-plugin-flowtypeeslint-plugin-reacteslint-plugin-jesteslint-plugin-react-hookseslint-plugin-react-nativeeslint-plugin-react-native-globalsescape-goateslint-utilseslint-scopeeslint-visitor-keysespreeesprimaesqueryesrecurseestraverseesutilsdeepmergeescodegenetagconventional-changelog-writerexecaescape-htmlexpand-bracketsexpectevent-target-shimextendextend-shallowextglobexec-sheventemitter3fast-deep-equalfast-difffast-globfast-json-stable-stringifyfast-levenshteinfastqfb-watchmanexternal-editorextsprintffancy-logfiguresfile-entry-cachefile-uri-to-pathfbjsfill-rangefbjs-css-varsfbjs-scriptsfind-cache-dirfind-upfilter-objfilelistfinalhandlerfind-versionsfor-inflattedflatform-datafragment-cachefs.realpathfunction-bindfseventsfunctional-red-black-treegensyncget-caller-fileget-intrinsicflat-cachefreshfs-extraexitget-streamget-valuegh-gotget-package-typeget-stdinget-pkg-repogit-raw-commitsgit-semver-tagsgithub-usernameglobglob-parentgetpassgit-remote-origin-urlgit-upglobalsglobbygotforever-agentgitconfiglocalglobal-dirsgrowlyhandlebarshas-flaghashas-symbolshas-valuehar-schemahas-valueshar-validatorhard-rejectionhas-yarnhermes-enginehermes-profile-transformerhttp-cache-semanticshtml-encoding-snifferhtml-escapergraceful-fshuman-signalsiconv-liteignorehttp-signaturegit-url-parseimport-freshieee754image-sizeimurmurhashimport-localindent-stringinflightimport-cwdinheritsimport-fromimport-lazyinternal-slothttp-errorsiniinquirerinterprethttp2-wrapperis-absoluteis-accessor-descriptoris-arrayishis-bufferinvariantis-callableis-ciis-core-moduleis-data-descriptoris-date-objectis-descriptoris-directoryis-extendableis-extglobhosted-git-infoipis-generator-fnis-git-dirtyis-globis-git-repositoryip-regexis-finiteis-numberis-fullwidth-code-pointis-negative-zerois-path-cwdis-npmis-path-insideis-objis-plain-objectis-interactiveis-relativeis-regexis-streamis-stringis-symbolis-installed-globallyis-dockeris-typedarrayis-unc-pathis-text-pathis-windowsis-potential-custom-element-nameis-plain-objisarrayis-utf8isexeisobjectis-wslistanbul-lib-coverageistanbul-lib-reportis-yarn-globalisomorphic-fetchistanbul-lib-source-mapsjest-clijest-configjest-docblockisstreamjest-diffjest-eachjakejest-environment-nodejest-get-typejest-haste-mapjest-changed-filesjest-message-utiljest-mockjest-regex-utilis-sshjest-resolvejest-environment-jsdomjest-runtimejest-runnerjest-leak-detectorjest-snapshotjest-utiljest-validatejest-watcherjest-resolve-dependenciesjest-pnp-resolverjest-workerjest-serializerjs-tokensjs-yamlistanbul-reportsjetifieristanbul-lib-instrumentjson-bufferjsescjson-parse-even-better-errorsjson-parse-better-errorsjsbnjson-schema-traversejsc-androidjson-stable-stringify-without-jsonifyjsdomjson5json-stringify-safejson-schemajson-stable-stringifyjsonfilejsx-ast-utilskeyvkind-ofkleurjsonifyjsonparselevenlevnlines-and-columnsjsprimlocate-pathlodashlodash.debounceklawlatest-versionlodash.sortbyload-json-filelodash.ismatchlodash.throttlelogkittylowercase-keyslru-cacheloose-envifylog-symbolsmakeerrormap-cacheloud-rejectionmap-visitmerge2merge-streammacos-releasemap-objmake-dirmetrometro-babel-registermetro-babel-transformermetro-cachemeowmetro-configmetro-react-native-babel-presetmetro-inspector-proxymetro-coremetro-minify-uglifymetro-source-mapmicromatchmetro-react-native-babel-transformermetro-resolvermetro-symbolicatemimic-fnmimic-responsemimeminimatchmime-typesmixin-deepmime-dbmin-indentminimistmsmkdirpmodify-valuesnanomatchnatural-compareminimist-optionsmute-streamnannegotiatornice-trynode-int64neo-asyncnode-fetchnode-stream-zipnode-releasesnocachenormalize-pathnormalize-urlnpm-run-pathnode-modules-regexpnullthrowsnode-notifiernormalize-package-dataobject-assignobject-keysobject-copyobject-inspectobject-visitobject.assignobject.entriesobject.fromentriesobject.picknwsapioauth-signobject.valuesob1onceonetimeon-finishedoptionatoropencollective-postinstallon-headersopenoptionsp-cancelablep-each-seriesorap-limitp-locatep-mapp-tryos-nameparent-moduleos-tmpdirparse-jsonpackage-jsonp-finallyparse-github-repo-urlpascalcasepath-is-absolutepath-existsparse5path-typepath-parsepicomatchparse-node-versionparseurlperformance-nowparse-pathpinkiepifyplease-upgrade-nodepinkie-promiseposix-character-classespkg-dirplugin-errorprelude-lsprepend-httppretty-formatprettier-linter-helperspiratesparse-urlprop-typespromiseprepend-fileprocess-nextick-argsprogresspumppseudomapprotocolspunycodepslqqueue-microtaskpupaqsquery-stringrange-parserreact-isreact-native-animatablequick-lrurcreact-devtools-coreplistreact-refreshread-pkgread-pkg-upregeneratereadable-streamredentregenerator-runtimeregex-notregenerator-transformrechoirregexp.prototype.flagsregexppregenerate-unicode-propertiesregexpu-corepromptsregjsgenregjsparserremove-trailing-separatorrepeat-elementrepeat-stringpath-keyregistry-urlregistry-auth-tokenrepeatingrequire-directoryrequest-promise-corerequire-main-filenameresolverequestresolve-cwdresolve-fromrequest-promise-nativerequire-from-stringresponselikeresolve-globalretreusifyrestore-cursorresolve-alpnrimrafresolve-urlrun-parallelretryrx-litesafe-regexsafe-bufferrun-asyncrsvpsanesafer-bufferrx-lite-aggregatessaxsemversemver-comparerxjsschedulersaxessemver-diffsemver-regexset-blockingset-valuesendserialize-errorserve-staticshebang-commandsetimmediatesetprototypeofshebang-regexside-channelsignal-exitshell-quotesisteransislashsimple-plistsnapdragonsnapdragon-nodesnapdragon-utilsource-mapsource-map-resolvejest-jasmine2source-map-supportshellwordssource-map-urlshelljsspdx-expression-parseslice-ansispdx-correctspdx-exceptionssplit-stringsplitsplit-on-firststack-utilssplit2spdx-license-idsstatic-extendsprintf-jssshpkstacktrace-parserstream-buffersstring-lengthstring-widthstatusesstring.prototype.matchallstealthy-requirestrict-uri-encodestrip-ansistring.prototype.trimendstrip-final-newlinestring_decoderstrip-json-commentsstring.prototype.trimstartstrip-indentsupports-colorsupports-hyperlinkstablestrip-eofjest-matcher-utilssudo-promptstackframesymbol-treestrip-bomtemp-dirterminal-linktemp-writetext-tablethroattemptext-extensionsthrough2tmplto-fast-propertiesto-object-pathto-readable-streamto-regexto-regex-rangetest-excludethroughtime-stamptoidentifiertough-cookietsutilstrim-off-newlinestslibtr46trim-newlinestype-detecttunnel-agenttype-checktypedarray-to-buffertweetnacltype-festtypedarrayuglify-esunc-path-regexunicode-canonical-property-names-ecmascriptunicode-match-property-ecmascriptunicode-match-property-value-ecmascriptunicode-property-aliases-ecmascriptunion-valueua-parser-jsuglify-jsuniversalifyultronunset-valueunique-stringuri-jsurixunpipeurl-parse-laxuseuniversal-user-agentupdate-notifiertmpurl-joinuse-subscriptionv8-compile-cacheutil-deprecateuuidutils-mergevalidate-npm-package-licensevalidate-npm-package-namev8-to-istanbulverrorvaryvlqw3c-hr-timewalkerwcwidthwhatwg-fetchwhichwhich-modulewebidl-conversionswhatwg-urlword-wrapwhatwg-mimetypewhich-pm-runswrap-ansiwrappywrite-file-atomicwindows-releasewidest-linewswordwrapwhatwg-encodingxcodexdg-basedirxmldocxmlcharsxml-name-validatory18nyallistxtendyargsyargs-parserxmldomxpipew3c-xmlserializeryamlyocto-queuexmlbuilder
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago