From 0097ae2a775b48bcc5b69d54d4ea1a5febc9855e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Darveau?= Date: Sun, 27 Jun 2021 15:17:23 -0400 Subject: [PATCH] Add custom icons to bookmarks (#5) * allow custom icons for bookmarks * update docker-image action to tag images based on source branch --- client/src/components/Bookmarks/Bookmarks.tsx | 6 +-- client/src/store/actions/app.ts | 43 ++++++++++--------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/client/src/components/Bookmarks/Bookmarks.tsx b/client/src/components/Bookmarks/Bookmarks.tsx index cd1b181..e8c23d0 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: "", - url: "", + name: "string", + url: "string", categoryId: -1, - icon: "", + icon: "string", isPinned: false, orderId: 0, id: 0, diff --git a/client/src/store/actions/app.ts b/client/src/store/actions/app.ts index c6da7f8..91fa3b8 100644 --- a/client/src/store/actions/app.ts +++ b/client/src/store/actions/app.ts @@ -132,35 +132,36 @@ export const pinApp = (app: App) => async (dispatch: Dispatch) => { /** * ADD APP - */ + */ export interface AddAppAction { type: ActionTypes.addAppSuccess; payload: App; } -export const addApp = (formData: NewApp | FormData) => async (dispatch: Dispatch) => { - try { - const res = await axios.post>("/api/apps", formData); +export const addApp = + (formData: NewApp | FormData) => async (dispatch: Dispatch) => { + try { + const res = await axios.post>("/api/apps", formData); - dispatch({ - type: ActionTypes.createNotification, - payload: { - title: "Success", - message: `App ${res.data.data.name} added`, - }, - }); + dispatch({ + type: ActionTypes.createNotification, + payload: { + title: "Success", + message: `App ${res.data.data.name} added`, + }, + }); - await dispatch({ - type: ActionTypes.addAppSuccess, - payload: res.data.data, - }); + await dispatch({ + type: ActionTypes.addAppSuccess, + payload: res.data.data, + }); - // Sort apps - dispatch(sortApps()); - } catch (err) { - console.log(err); - } -}; + // Sort apps + dispatch(sortApps()); + } catch (err) { + console.log(err); + } + }; /** * PIN CATEGORY