calendar menu: make weather optional (#253)
* calendar menu: make weather optional adds a setting to enable or disable the weather widget in the calendar menu. * Fix bottom margin of last child card. * Fix calendar dropdown merge linting and formatting errors. * Settings dialog formatting error fix. --------- Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import DropdownMenu from '../shared/dropdown/index.js';
|
||||
import { TimeWidget } from './time/index.js';
|
||||
import { CalendarWidget } from './calendar.js';
|
||||
import { WeatherWidget } from './weather/index.js';
|
||||
import Window from 'types/widgets/window.js';
|
||||
import { Attribute, Child } from 'lib/types/widget.js';
|
||||
import DropdownMenu from 'modules/menus/shared/dropdown/index';
|
||||
import { TimeWidget } from './time/index';
|
||||
import { CalendarWidget } from './calendar';
|
||||
import { WeatherWidget } from './weather/index';
|
||||
import options from 'options';
|
||||
import Window from 'types/widgets/window';
|
||||
import { Attribute, Child } from 'lib/types/widget';
|
||||
|
||||
const { enabled: weatherEnabled } = options.menus.clock.weather;
|
||||
|
||||
export default (): Window<Child, Attribute> => {
|
||||
return DropdownMenu({
|
||||
@@ -21,7 +24,9 @@ export default (): Window<Child, Attribute> => {
|
||||
Widget.Box({
|
||||
class_name: 'calendar-content-items',
|
||||
vertical: true,
|
||||
children: [TimeWidget(), CalendarWidget(), WeatherWidget()],
|
||||
children: weatherEnabled.bind('value').as((isWeatherEnabled) => {
|
||||
return [TimeWidget(), CalendarWidget(), ...(isWeatherEnabled ? [WeatherWidget()] : [])];
|
||||
}),
|
||||
}),
|
||||
],
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user