]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/tracker/CountDisplay.js
simple tracker config dialog
[alttp.git] / resources / js / components / tracker / CountDisplay.js
index ed9b91fc5efbd63955f67bc273d4aa88b246a358..8282422486c92059f574a70f7ea0715e2bf37f53 100644 (file)
@@ -1,7 +1,7 @@
 import PropTypes from 'prop-types';
 import React from 'react';
 
-const CountDisplay = ({ className, count }) => {
+const CountDisplay = ({ className, count, full }) => {
        const classNames = ['count-display'];
        if (className) {
                classNames.push(className);
@@ -9,6 +9,9 @@ const CountDisplay = ({ className, count }) => {
        if (!count) {
                classNames.push('is-zero');
        }
+       if (full && count >= full) {
+               classNames.push('is-full');
+       }
        return <span className={classNames.join(' ')}>
                {count}
        </span>;
@@ -17,6 +20,7 @@ const CountDisplay = ({ className, count }) => {
 CountDisplay.propTypes = {
        className: PropTypes.string,
        count: PropTypes.number,
+       full: PropTypes.number,
 };
 
 export default CountDisplay;