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:
parent
504e399fc1
commit
605e110509
4 changed files with 4 additions and 21 deletions
|
@ -25,7 +25,7 @@ interface ComponentProps {
|
|||
|
||||
export enum ContentType {
|
||||
category,
|
||||
app
|
||||
app,
|
||||
}
|
||||
|
||||
const Apps = (props: ComponentProps): JSX.Element => {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue