Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make spacing between Weekdays and ScrollView configurable #36

Open
MarcGarciaSunweb opened this issue Oct 2, 2024 · 0 comments
Open

Comments

@MarcGarciaSunweb
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant