Skip to content

Make spacing between Weekdays and ScrollView configurable #36

@MarcGarciaSunweb

Description

@MarcGarciaSunweb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions