diff --git a/client/src/components/Apps/Apps.tsx b/client/src/components/Apps/Apps.tsx index a62a941..c7718da 100644 --- a/client/src/components/Apps/Apps.tsx +++ b/client/src/components/Apps/Apps.tsx @@ -25,7 +25,7 @@ interface ComponentProps { export enum ContentType { category, - app + app, } const Apps = (props: ComponentProps): JSX.Element => { @@ -34,24 +34,26 @@ const Apps = (props: ComponentProps): JSX.Element => { const [modalIsOpen, setModalIsOpen] = useState(false); const [formContentType, setFormContentType] = useState(ContentType.category); const [isInEdit, setIsInEdit] = useState(false); - const [tableContentType, setTableContentType] = useState(ContentType.category); + const [tableContentType, setTableContentType] = useState( + ContentType.category + ); const [isInUpdate, setIsInUpdate] = useState(false); const [categoryInUpdate, setCategoryInUpdate] = useState({ - name: '', + name: "", id: -1, isPinned: false, orderId: 0, - type: 'apps', + type: "apps", apps: [], bookmarks: [], createdAt: new Date(), - updatedAt: new Date() - }) + updatedAt: new Date(), + }); const [appInUpdate, setAppInUpdate] = useState({ - name: 'string', - url: 'string', + name: "string", + url: "string", categoryId: -1, - icon: 'string', + icon: "string", isPinned: false, orderId: 0, id: 0, diff --git a/client/src/components/Bookmarks/BookmarkTable/BookmarkTable.tsx b/client/src/components/Bookmarks/BookmarkTable/BookmarkTable.tsx index 62d841d..084f670 100644 --- a/client/src/components/Bookmarks/BookmarkTable/BookmarkTable.tsx +++ b/client/src/components/Bookmarks/BookmarkTable/BookmarkTable.tsx @@ -191,7 +191,9 @@ const BookmarkTable = (props: ComponentProps): JSX.Element => {
props.pinBookmarkCategory(category)} + onClick={() => + props.pinBookmarkCategory(category) + } onKeyDown={(e) => keyboardActionHandler( e, diff --git a/client/src/components/Bookmarks/Bookmarks.tsx b/client/src/components/Bookmarks/Bookmarks.tsx index e8c23d0..cd1b181 100644 --- a/client/src/components/Bookmarks/Bookmarks.tsx +++ b/client/src/components/Bookmarks/Bookmarks.tsx @@ -50,10 +50,10 @@ const Bookmarks = (props: ComponentProps): JSX.Element => { updatedAt: new Date(), }); const [bookmarkInUpdate, setBookmarkInUpdate] = useState({ - name: "string", - url: "string", + name: "", + url: "", categoryId: -1, - icon: "string", + icon: "", isPinned: false, orderId: 0, id: 0, diff --git a/client/src/store/actions/app.ts b/client/src/store/actions/app.ts index dc25f66..c6da7f8 100644 --- a/client/src/store/actions/app.ts +++ b/client/src/store/actions/app.ts @@ -132,7 +132,7 @@ export const pinApp = (app: App) => async (dispatch: Dispatch) => { /** * ADD APP - */ + */ export interface AddAppAction { type: ActionTypes.addAppSuccess; payload: App; diff --git a/client/src/store/reducers/app.ts b/client/src/store/reducers/app.ts index e01650a..37eb1c3 100644 --- a/client/src/store/reducers/app.ts +++ b/client/src/store/reducers/app.ts @@ -88,7 +88,9 @@ const pinCategory = (state: State, action: Action): State => { const pinApp = (state: State, action: Action): State => { const tmpApps = [...state.apps]; - const changedApp = tmpApps.find((app: App) => app.id === action.payload.id); + const changedApp = tmpApps.find( + (app: App) => app.id === action.payload.id + ); if (changedApp) { changedApp.isPinned = action.payload.isPinned; @@ -243,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(category.apps, action.payload); - // }); - - // return { - // ...state, - // categories: tmpCategories, - // }; const sortedApps = sortData(state.apps, action.payload); return {