1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-27 23:09:35 +02:00

Add custom icons to bookmarks (#5)

* allow custom icons for bookmarks

* update docker-image action to tag images based on source branch
This commit is contained in:
François Darveau 2021-06-27 15:17:23 -04:00 committed by François Darveau
parent 1b57668792
commit 0097ae2a77
2 changed files with 25 additions and 24 deletions

View file

@ -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: "", name: "string",
url: "", url: "string",
categoryId: -1, categoryId: -1,
icon: "", icon: "string",
isPinned: false, isPinned: false,
orderId: 0, orderId: 0,
id: 0, id: 0,

View file

@ -132,35 +132,36 @@ export const pinApp = (app: App) => async (dispatch: Dispatch) => {
/** /**
* ADD APP * ADD APP
*/ */
export interface AddAppAction { export interface AddAppAction {
type: ActionTypes.addAppSuccess; type: ActionTypes.addAppSuccess;
payload: App; payload: App;
} }
export const addApp = (formData: NewApp | FormData) => async (dispatch: Dispatch) => { export const addApp =
try { (formData: NewApp | FormData) => async (dispatch: Dispatch) => {
const res = await axios.post<ApiResponse<App>>("/api/apps", formData); try {
const res = await axios.post<ApiResponse<App>>("/api/apps", formData);
dispatch<CreateNotificationAction>({ dispatch<CreateNotificationAction>({
type: ActionTypes.createNotification, type: ActionTypes.createNotification,
payload: { payload: {
title: "Success", title: "Success",
message: `App ${res.data.data.name} added`, message: `App ${res.data.data.name} added`,
}, },
}); });
await dispatch<AddAppAction>({ await dispatch<AddAppAction>({
type: ActionTypes.addAppSuccess, type: ActionTypes.addAppSuccess,
payload: res.data.data, payload: res.data.data,
}); });
// Sort apps // Sort apps
dispatch<any>(sortApps()); dispatch<any>(sortApps());
} catch (err) { } catch (err) {
console.log(err); console.log(err);
} }
}; };
/** /**
* PIN CATEGORY * PIN CATEGORY