Skip to content

Commit

Permalink
fix nanoanim removal
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-sz committed Oct 25, 2023
1 parent 98a40f9 commit c7c141b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 35 deletions.
11 changes: 0 additions & 11 deletions web/src/animationSettings.ts

This file was deleted.

10 changes: 2 additions & 8 deletions web/src/components/NetworkTile.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React from 'react';
import clsx from 'clsx';
import { useTranslation } from 'react-i18not';
import { motion } from 'nanoanim';
import { IoAdd } from 'react-icons/io5';
import { ClientModel } from '@filedrop/types';

import styles from './NetworkTile.module.scss';
import { animationPropsOpacity } from '../animationSettings.js';
import { TargetTile } from './TargetTile.js';
import { networkStore } from '../stores/index.js';

Expand Down Expand Up @@ -34,11 +32,7 @@ export const NetworkTile: React.FC<NetworkTileProps> = ({
};

return (
<motion.div
{...animationPropsOpacity}
onClick={onClick}
className={styles.wrapper}
>
<div onClick={onClick} className={styles.wrapper}>
<TargetTile client={client} variant="big" className={clsx(styles.tile)}>
{!onSelect && (
<input
Expand All @@ -60,6 +54,6 @@ export const NetworkTile: React.FC<NetworkTileProps> = ({
</div>
</TargetTile>
<div className={styles.name}>{client.clientName}</div>
</motion.div>
</div>
);
};
6 changes: 1 addition & 5 deletions web/src/components/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ import { observer } from 'mobx-react-lite';
import clsx from 'clsx';

import styles from './Status.module.scss';
import { animationPropsOpacity } from '../animationSettings.js';
import { connection } from '../stores/index.js';

export const Status: React.FC = observer(() => {
const { t } = useTranslation();

return !connection.connected && !connection.disconnectReason ? (
<div
{...animationPropsOpacity}
className={clsx(styles.status, styles.error)}
>
<div className={clsx(styles.status, styles.error)}>
<div>{t('state.connecting')}</div>
</div>
) : null;
Expand Down
7 changes: 2 additions & 5 deletions web/src/sections/Chat/ChatItem.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, { useLayoutEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18not';
import { motion } from 'nanoanim';
import { observer } from 'mobx-react-lite';
import clsx from 'clsx';

import styles from './ChatItem.module.scss';
import { animationPropsSlide } from '../../animationSettings.js';
import { ChatItemModel } from '../../types/Models.js';
import { copy } from '../../utils/copy.js';
import { TargetTile } from '../../components/TargetTile.js';
Expand Down Expand Up @@ -45,11 +43,10 @@ export const ChatItem: React.FC<ChatItemProps> = observer(({ item }) => {
}, [setExpanded]);

return (
<motion.li
<li
className={clsx(styles.item, {
[styles.expanded]: expanded,
})}
{...animationPropsSlide}
>
<div className={styles.info}>
{client && <TargetTile client={client} />}
Expand All @@ -67,6 +64,6 @@ export const ChatItem: React.FC<ChatItemProps> = observer(({ item }) => {
{t('chat.showMore')}
</button>
)}
</motion.li>
</li>
);
});
3 changes: 1 addition & 2 deletions web/src/sections/Chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import clsx from 'clsx';

import styles from './index.module.scss';
import { ChatItem } from './ChatItem.js';
import { animationPropsOpacity } from '../../animationSettings.js';
import { IconButton } from '../../components/IconButton.js';
import { applicationStore, chatStore } from '../../stores/index.js';
import { TargetTile } from '../../components/TargetTile.js';
Expand Down Expand Up @@ -87,7 +86,7 @@ export const ChatSection: React.FC = observer(() => {
</div>
<React.Fragment key={chatStore.currentChannel}>
{chat.length === 0 ? (
<div className={styles.empty} {...animationPropsOpacity}>
<div className={styles.empty}>
<IoChatbox />
<div className={styles.title}>{t('emptyChat.title')}</div>
<div>
Expand Down
6 changes: 2 additions & 4 deletions web/src/sections/Transfers/Transfer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React from 'react';
import { useTranslation } from 'react-i18not';
import { motion } from 'nanoanim';
import { observer } from 'mobx-react-lite';

import styles from './index.module.scss';
import { animationPropsSlide } from '../../../animationSettings.js';
import { TransferState } from '../../../types/TransferState.js';
import { formatFileName, formatFileSize } from '../../../utils/file.js';
import { humanTime } from '../../../utils/time.js';
Expand All @@ -31,7 +29,7 @@ export const TransferInfo: React.FC<TransferProps> = observer(
const left = humanTime(transfer.timeLeft());

return (
<motion.li className={styles.transfer} {...animationPropsSlide}>
<li className={styles.transfer}>
<TransferIcon transfer={transfer} />
<div className={styles.state}>
<div className={styles.filename}>
Expand Down Expand Up @@ -68,7 +66,7 @@ export const TransferInfo: React.FC<TransferProps> = observer(
</div>
</div>
<TransferActions transfer={transfer} />
</motion.li>
</li>
);
}
);

0 comments on commit c7c141b

Please sign in to comment.