mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-29 07:39:36 +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 {
|
export enum ContentType {
|
||||||
category,
|
category,
|
||||||
app
|
app,
|
||||||
}
|
}
|
||||||
|
|
||||||
const Apps = (props: ComponentProps): JSX.Element => {
|
const Apps = (props: ComponentProps): JSX.Element => {
|
||||||
|
|
|
@ -50,10 +50,10 @@ const Bookmarks = (props: ComponentProps): JSX.Element => {
|
||||||
updatedAt: new Date(),
|
updatedAt: new Date(),
|
||||||
});
|
});
|
||||||
const [bookmarkInUpdate, setBookmarkInUpdate] = useState<Bookmark>({
|
const [bookmarkInUpdate, setBookmarkInUpdate] = useState<Bookmark>({
|
||||||
name: "string",
|
name: "",
|
||||||
url: "string",
|
url: "",
|
||||||
categoryId: -1,
|
categoryId: -1,
|
||||||
icon: "string",
|
icon: "",
|
||||||
isPinned: false,
|
isPinned: false,
|
||||||
orderId: 0,
|
orderId: 0,
|
||||||
id: 0,
|
id: 0,
|
||||||
|
|
|
@ -59,13 +59,6 @@ const Home = (props: ComponentProps): JSX.Element => {
|
||||||
}
|
}
|
||||||
}, [getAppCategories]);
|
}, [getAppCategories]);
|
||||||
|
|
||||||
// Load app categories
|
|
||||||
useEffect(() => {
|
|
||||||
if (appCategories.length === 0) {
|
|
||||||
getAppCategories();
|
|
||||||
}
|
|
||||||
}, [getAppCategories]);
|
|
||||||
|
|
||||||
// Load apps
|
// Load apps
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (apps.length === 0) {
|
if (apps.length === 0) {
|
||||||
|
|
|
@ -245,16 +245,6 @@ const reorderApps = (state: State, action: Action): State => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const sortApps = (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);
|
const sortedApps = sortData<App>(state.apps, action.payload);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue