mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 07:18:47 +00:00
add greeting and datetime info widgets
This commit is contained in:
parent
43f7ccd166
commit
0075429e08
4 changed files with 66 additions and 4 deletions
|
@ -2,6 +2,8 @@ import WeatherApi from "components/widgets/weather/weather";
|
|||
import OpenWeatherMap from "components/widgets/openweathermap/weather";
|
||||
import Resources from "components/widgets/resources/resources";
|
||||
import Search from "components/widgets/search/search";
|
||||
import Greeting from "components/widgets/greeting/greeting";
|
||||
import DateTime from "components/widgets/datetime/datetime";
|
||||
|
||||
const widgetMappings = {
|
||||
weather: WeatherApi, // This key will be deprecated in the future
|
||||
|
@ -9,13 +11,15 @@ const widgetMappings = {
|
|||
openweathermap: OpenWeatherMap,
|
||||
resources: Resources,
|
||||
search: Search,
|
||||
greeting: Greeting,
|
||||
datetime: DateTime,
|
||||
};
|
||||
|
||||
export default function Widget({ widget }) {
|
||||
const ServiceWidget = widgetMappings[widget.type];
|
||||
const InfoWidget = widgetMappings[widget.type];
|
||||
|
||||
if (ServiceWidget) {
|
||||
return <ServiceWidget options={widget.options} />;
|
||||
if (InfoWidget) {
|
||||
return <InfoWidget options={widget.options} />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue