CalendarView icon indicating copy to clipboard operation
CalendarView copied to clipboard

Make spacing between Weekdays and ScrollView configurable

Open MarcGarciaSunweb opened this issue 1 year ago • 0 comments

Description

MCalendarView struct is currently defined like this:

public struct MCalendarView: View {
    @StateObject var selectedData: Data.MCalendarView
    let monthsData: [Data.MonthView]
    let configData: CalendarConfig

    init(_ selectedDate: Binding<Date?>?, _ selectedRange: Binding<MDateRange?>?, _ configBuilder: (CalendarConfig) -> CalendarConfig) {
        self._selectedData = .init(wrappedValue: .init(selectedDate, selectedRange))
        self.configData = configBuilder(.init())
        self.monthsData = .generate()
    }
    public var body: some View {
        VStack(spacing: 12) {
            createWeekdaysView()
            createScrollView()
        }
    }
}

Making the spacing between Weekdays and ScrollView fixed and not configurable.

Proposal

I propose to add another parameter in configData, maybe something called: weekdaysBottomSpacing with default value 12.

Motivation

WeekdayView can be customized making a custom implementation of the WeekdaysView protocol, therefor, this fixed 12 pixels spacing could make the design on the calendar strange adding an additional spacing.

MarcGarciaSunweb avatar Oct 02 '24 06:10 MarcGarciaSunweb