1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-29 15:49:37 +02:00

add bookmark sorting (#3)

This commit is contained in:
François Darveau 2021-06-26 16:22:54 -04:00 committed by François Darveau
parent 504e399fc1
commit 605e110509
4 changed files with 4 additions and 21 deletions

View file

@ -25,7 +25,7 @@ interface ComponentProps {
export enum ContentType {
category,
app
app,
}
const Apps = (props: ComponentProps): JSX.Element => {

View file

@ -50,10 +50,10 @@ const Bookmarks = (props: ComponentProps): JSX.Element => {
updatedAt: new Date(),
});
const [bookmarkInUpdate, setBookmarkInUpdate] = useState<Bookmark>({
name: "string",
url: "string",
name: "",
url: "",
categoryId: -1,
icon: "string",
icon: "",
isPinned: false,
orderId: 0,
id: 0,

View file

@ -59,13 +59,6 @@ const Home = (props: ComponentProps): JSX.Element => {
}
}, [getAppCategories]);
// Load app categories
useEffect(() => {
if (appCategories.length === 0) {
getAppCategories();
}
}, [getAppCategories]);
// Load apps
useEffect(() => {
if (apps.length === 0) {

View file

@ -245,16 +245,6 @@ const reorderApps = (state: State, action: Action): State => {
};
const sortApps = (state: State, action: Action): State => {
// const tmpCategories = [...state.categories];
// tmpCategories.forEach((category: Category) => {
// category.apps = sortData<App>(category.apps, action.payload);
// });
// return {
// ...state,
// categories: tmpCategories,
// };
const sortedApps = sortData<App>(state.apps, action.payload);
return {