Skip to content

Commit

Permalink
Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
maksis committed Jun 19, 2024
1 parent d5f081b commit 4f628ab
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 119 deletions.
130 changes: 65 additions & 65 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions resources/locales/en/webui.main.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@
"common": {
"actions": {
"copy": "Copy",
"copyPath": "Copy path",
"copySize": "Copy size",
"copyTth": "Copy TTH",
"download": "Download",
"downloadTo": "Download to...",
"findNfo": "Find NFO",
Expand All @@ -280,6 +283,9 @@
"notifications": {
"ignoreUserSuccess": "User {{item.nicks}} was added in ignored users",
"unignoreUserSuccess": "User {{item.nicks}} was removed from ignored users",
"copyPathSuccess": "Path was copied to clipboard",
"copySizeSuccess": "Size was copied to clipboard",
"copyTTHSuccess": "TTH was copied to clipboard",
"copyMagnetSuccess": "Magnet link was copied to clipboard",
"copySuccess": "Text was copied to clipboard"
},
Expand Down
2 changes: 1 addition & 1 deletion src/actions/ui/queue/QueueBundleActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const QueueBundleSearchAction = {
};

export const QueueBundleSearchAlternatesAction = {
id: 'searchAlternates',
id: 'searchBundleAlternates',
displayName: 'Search for alternates',
icon: IconConstants.SEARCH_ALTERNATES,
filter: itemNotFinished,
Expand Down
5 changes: 0 additions & 5 deletions src/actions/ui/queue/QueueBundleSourceActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import IconConstants from 'constants/IconConstants';
import * as API from 'types/api';
import * as UI from 'types/ui';

/*interface ActionBundleSourceData {
source: API.QueueBundleSource;
bundle: API.QueueBundle;
}*/

type ActionHandlerType = UI.ActionHandler<API.QueueBundleSource, API.QueueBundle>;

const handleRemoveBundleSource: ActionHandlerType = ({
Expand Down
4 changes: 2 additions & 2 deletions src/actions/ui/share/ShareActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const handleRefresh = () => {
};

export const ShareRefreshAction = {
id: 'refresh',
displayName: 'Refresh',
id: 'refreshAll',
displayName: 'Refresh all',
access: API.AccessEnum.SETTINGS_EDIT,
icon: IconConstants.REFRESH_COLORED,
handler: handleRefresh,
Expand Down
47 changes: 22 additions & 25 deletions src/components/CountLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ export interface CountLabelProps {
onClick?: (evt: React.SyntheticEvent<any>) => void;
}

const CountLabel: React.FC<CountLabelProps> = ({
urgencies,
empty,
size,
className,
circular,
onClick,
}) => {
const CountLabel = React.forwardRef<HTMLDivElement, CountLabelProps>(function CountLabel(
{ urgencies, empty = false, size, className, circular = false, onClick },
ref,
) {
// We must always have valid urgencies when the component is rendered (checked by AnimatedCountLabel)
if (!urgencies) {
return null;
Expand All @@ -46,11 +42,11 @@ const CountLabel: React.FC<CountLabelProps> = ({
);

return (
<div className={labelClassName} onClick={onClick}>
<div ref={ref} className={labelClassName} onClick={onClick}>
{empty ? null : urgencies[max]}
</div>
);
};
});

/*CountLabel.propTypes = {
// Urgency mapping [ urgency -> count ]
Expand All @@ -63,21 +59,22 @@ const CountLabel: React.FC<CountLabelProps> = ({
empty: PropTypes.bool,
};*/

CountLabel.defaultProps = {
empty: false,
size: '',
circular: false,
};

// Fade out the label when there are no counts
const AnimatedCountLabel: React.FC<CountLabelProps> = (props) => (
<TransitionGroup component={null}>
{!!props.urgencies && (
<CSSTransition classNames="label-transition" timeout={{ enter: 100, exit: 1500 }}>
<CountLabel key="label" {...props} />
</CSSTransition>
)}
</TransitionGroup>
);
const AnimatedCountLabel: React.FC<CountLabelProps> = (props) => {
const nodeRef = React.useRef(null);
return (
<TransitionGroup component={null}>
{!!props.urgencies && (
<CSSTransition
nodeRef={nodeRef}
classNames="label-transition"
timeout={{ enter: 100, exit: 1500 }}
>
<CountLabel ref={nodeRef} key="label" {...props} />
</CSSTransition>
)}
</TransitionGroup>
);
};

export default AnimatedCountLabel;
Loading

0 comments on commit 4f628ab

Please sign in to comment.