Skip to content

Commit

Permalink
added empty list & remove unlock when user is not connected
Browse files Browse the repository at this point in the history
  • Loading branch information
EnzoVezzaro committed Oct 3, 2023
1 parent 0a67809 commit 4a147c2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/components/HistoryList/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@
top: 60%;
left: 50%;
}

.emptyList{
margin-top: calc(var(--spacer) / var(--line-height));
}
15 changes: 13 additions & 2 deletions src/components/HistoryList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Button from '../Button'
import styles from './index.module.css'
import { addEllipsesToText } from '../../@utils/textFormat'
import Loader from '../Loader';
import { useAccount } from 'wagmi'
import { getStatusMessage } from '../../@utils/statusCode'
import { getLink } from '../../@utils/linkAsset'
import Pagination from './pagination';
Expand All @@ -25,8 +26,10 @@ const HistoryList = ({
historyTotalPages: number
changeHistoryPage: any
}): ReactElement => {
const { isConnected } = useAccount()

const [currentPage, setCurrentPage] = useState(1);
const [files, setFiles] = React.useState<any[]>([]);
const [files, setFiles] = React.useState<any[]>([]);

const ITEMS_PER_PAGE = 25;

Expand Down Expand Up @@ -75,9 +78,17 @@ const HistoryList = ({
</td>
</tr>
))}
{
currentFiles.length === 0 &&
<tr>
<td colSpan={5}>
<p className={styles.emptyList}>There's no files uploaded!</p>
</td>
</tr>
}
</tbody>
{
!historyUnlocked &&
isConnected && !historyUnlocked &&
<Button
className={styles.unlockButton}
style="primary"
Expand Down

0 comments on commit 4a147c2

Please sign in to comment.