return getEntryDate(entry);
};
-const Item = ({ entry }) => {
+const Item = ({ entry = {} }) => {
const { t } = useTranslation();
return <ListGroup.Item>
}),
};
-Item.defaultProps = {
- entry: {},
-};
-
export default Item;
import Item from './Item';
-const List = ({ log }) =>
+const List = ({ log = [] }) =>
<ListGroup variant="flush">
{log ? log.map(entry =>
<Item key={entry.id} entry={entry} />
})),
};
-List.defaultProps = {
- log: [],
-};
-
export default List;
import PropTypes from 'prop-types';
import React from 'react';
-const AspectBox = ({ children, ratio }) =>
+const AspectBox = ({ children = null, ratio = 1 }) =>
<div className="aspect-box-container" style={{ paddingTop: `${1 / ratio * 100}%`}}>
<div className="aspect-box-content">
{children}
ratio: PropTypes.number,
};
-AspectBox.defaultProps = {
- children: null,
- ratio: 1,
-};
-
export default AspectBox;
library.add(fas);
const Icon = ({
- alt,
- className,
+ alt = null,
+ className = '',
name,
- size,
- title,
+ size = null,
+ title = null,
}) =>
<FontAwesomeIcon
icon={name}
title: PropTypes.string,
};
-Icon.defaultProps = {
- alt: null,
- className: '',
- size: null,
- title: null,
-};
-
const makePreset = (presetDisplayName, presetName) => {
const preset = ({ alt, className, name, size, title}) => <Icon
alt={alt || i18n.t(`icon.${presetDisplayName}`)}
import Icon from './Icon';
const LargeCheck = ({
- className,
- id,
- name,
- onBlur,
- onChange,
- value,
+ className = '',
+ id = '',
+ name = '',
+ onBlur = null,
+ onChange = null,
+ value = false,
}) => {
let clsn = className ? `${className} custom-check` : 'custom-check';
if (value) {
value: PropTypes.bool,
};
-LargeCheck.defaultProps = {
- className: '',
- id: '',
- name: '',
- onBlur: null,
- onChange: null,
- value: false,
-};
-
export default LargeCheck;
import PropTypes from 'prop-types';
import React from 'react';
-const Slider = ({ children, duration, vertical }) => {
+const Slider = ({ children = null, duration = 2500, vertical = false }) => {
const [index, setIndex] = React.useState(0);
React.useEffect(() => {
vertical: PropTypes.bool,
};
-Slider.defaultProps = {
- duration: 2500,
-};
-
const Slide = ({ children }) => {
return <div className="slider-slide">
{children}
import Icon from './Icon';
const ToggleSwitch = ({
- isInvalid,
- isValid,
- name,
- offLabel,
- onBlur,
- onChange,
- onLabel,
- readonly,
- title,
- value,
+ isInvalid = false,
+ isValid = false,
+ name = '',
+ offLabel = '',
+ onBlur = null,
+ onChange = null,
+ onLabel = null,
+ readonly = false,
+ title = null,
+ value = false,
}) => {
const toggle = () => {
if (readonly) return;
};
ToggleSwitch.propTypes = {
- id: PropTypes.string,
isInvalid: PropTypes.bool,
isValid: PropTypes.bool,
name: PropTypes.string,
value: PropTypes.bool,
};
-ToggleSwitch.defaultProps = {
- id: '',
- isInvalid: false,
- isValid: false,
- name: '',
- offLabel: '',
- onBlur: null,
- onChange: null,
- onLabel: '',
- readonly: false,
- title: null,
- value: false,
-};
-
export default ToggleSwitch;
}
};
-const Item = ({ entry }) =>
+const Item = ({ entry = {} }) =>
<ListGroup.Item className="d-flex align-items-center">
<div className="pe-3 text-muted">
{getEntryIcon(entry)}
}),
};
-Item.defaultProps = {
- entry: {},
-};
-
export default withTranslation()(Item);
import Item from './Item';
-const List = ({ protocol }) =>
+const List = ({ protocol = [] }) =>
<ListGroup variant="flush">
{protocol ? protocol.map(entry =>
<Item key={entry.id} entry={entry} />
})),
};
-List.defaultProps = {
- protocol: [],
-};
-
export default List;
];
const SeedCodeInput = ({
- className,
- game,
- name,
- onBlur,
- onChange,
- value,
+ className = '',
+ game = '',
+ name = '',
+ onBlur = null,
+ onChange = null,
+ value = [],
}) => {
if (game === 'alttpr') {
const code_trans = ALTTPR_CODES
value: PropTypes.arrayOf(PropTypes.string),
};
-SeedCodeInput.defaultProps = {
- className: '',
- game: '',
- name: '',
- onBlur: null,
- onChange: null,
- value: [],
-};
-
export default withTranslation()(SeedCodeInput);
} from '../../helpers/tracker';
import { useTracker } from '../../hooks/tracker';
-const Dungeons = ({ columns }) => {
+const Dungeons = ({ columns = 4 }) => {
const { config, dungeons, state } = useTracker();
const layout = React.useMemo(() => {
columns: PropTypes.number,
};
-Dungeons.defaultProps = {
- columns: 4,
-};
-
export default Dungeons;