From 290c7f301b30973fdf5f3fc5a8ca902c47404208 Mon Sep 17 00:00:00 2001 From: Camille Moussu Date: Tue, 19 Aug 2025 14:07:37 +0200 Subject: [PATCH] [#32] added setup in readme and support to missing applist.js --- README.md | 18 +++++++++++++++++- src/components/Menubar/Menubar.tsx | 3 ++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 77cb611..a6babdb 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,23 @@ And then visit [https://localhost:5000](https://localhost:5000). ## Configuring it -More details to be supplied when available. +### App grid + +An applist is configurable in the public folder to setup the grid of app accessible within Twake Calendar. + +Each app has three fields: + +- name: the app’s name +- icon: the link to the app’s icon +- link: the app’s link or URL + +Example: + +```js +var appList = [ + { name: "My App", icon: "https://myapp.com/myapp.png", link: "https://myapp.com" }, +]; +``` ## Roadmap diff --git a/src/components/Menubar/Menubar.tsx b/src/components/Menubar/Menubar.tsx index 8846723..8d8c2f3 100644 --- a/src/components/Menubar/Menubar.tsx +++ b/src/components/Menubar/Menubar.tsx @@ -15,7 +15,7 @@ export type AppIconProps = { export function Menubar() { const user = useAppSelector((state) => state.user.userData); - const applist: AppIconProps[] = (window as any).appList; + const applist: AppIconProps[] = (window as any).appList ?? []; const [anchorEl, setAnchorEl] = useState(null); const dispatch = useAppDispatch(); @@ -93,6 +93,7 @@ function AppIcon({ prop }: { prop: AppIconProps }) {