diff --git a/src/pages/AssetLibrary/AssetLibrary.js b/src/pages/AssetLibrary/AssetLibrary.js index dfc7515..c0a6a4e 100644 --- a/src/pages/AssetLibrary/AssetLibrary.js +++ b/src/pages/AssetLibrary/AssetLibrary.js @@ -2,11 +2,12 @@ import React, { useState, useEffect } from 'react'; import { AssetLibraryModal } from "./AssetLibraryModal" import { MarketplaceAssetLibraryModal } from "./MarketplaceAssetLibraryModal" import { AnimationAssetLibraryModal } from "./AnimationAssetLibraryModal" -import { Typography, Tag, Button, Input } from 'antd'; -import { LinkOutlined, CheckCircleOutlined, DollarOutlined, HddOutlined } from '@ant-design/icons'; +import { Typography, Button, Input } from 'antd'; +import { LinkOutlined, CheckCircleOutlined, DollarOutlined, DeleteOutlined, FolderOpenOutlined, EditOutlined } from '@ant-design/icons'; import { db, auth } from "../../config/firebase"; import { getDocs, collection } from 'firebase/firestore' import { Navigate } from 'react-router-dom'; +import { sort } from 'fast-sort'; const { Title, Text } = Typography; const { Search } = Input; @@ -22,12 +23,16 @@ export const AssetLibrary = () => { const filterAllData = (allRefData) => { + allRefData.forEach(list => { list.forEach(asset => { setAssetData(allAssetData => [...allAssetData, asset]); setSearchData(assetSearchData => [...assetSearchData, asset]); }); }); + // let sortedFilteredData = sort(assetSearchData).desc(u => u["date-updated"]) + setSearchData(assetSearchData => sort(assetSearchData).desc(u => u["date-updated"])); + } @@ -157,9 +162,6 @@ export const AssetLibrary = () => { <> {asset.group == "Market" ? (