Skip to content

Feat/ support negative margin modifiers #2562

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

Closed
wants to merge 25 commits into from

Conversation

lidord-wix
Copy link
Contributor

Description

Support negative margin modifiers
#2507

Changelog

Support negative margin modifiers

@ethanshar
Copy link
Collaborator

@lidord-wix
How the usage will look like?
like this?

<View marginT--5/>

@lidord-wix
Copy link
Contributor Author

@lidord-wix How the usage will look like? like this?

<View marginT--5/>

Yes :)

@ethanshar
Copy link
Collaborator

ethanshar commented Apr 20, 2023

@lidord-wix How the usage will look like? like this?

<View marginT--5/>

Yes :)

Hmm it's a little nasty, but I understand the requirement.
Who requested it?

Btw, I thought about it a long time ago that the modifiers like margin/padding should be changed to numeric values to make them easier to pass
something like

<View marginT={5} marginH={-5} />

I know it's a little out of scope, but do you think it's a big effort supporting this? It will also will typings.

adids1221 and others added 24 commits May 15, 2023 13:38
* FlashList optional dependecy

* Update src/optionalDependencies/index.web.ts

Co-authored-by: Lidor Dafna <[email protected]>

---------

Co-authored-by: Lidor Dafna <[email protected]>
* SortableList - add driver and test

* Review fixes
* Add segmentStyle prop to SegmentedControl

* renaming

* renaming #2
* Initial creation of new calendar component

* Push typings

* render initial components for example screen

* Add DateUtils with stubs

* Add tests for DateUtils

* Add stub implementation to getDaysOfWeekNumber

* Day - render day from date

* Basic implementation of getWeekNumbersOfMonth

* Install date-fns

* Basic implementation of Month

* Add Week

* Fix Month component

* Change to millis

* Add key to week

* Fix hardcoded month value we pass to Month component

* Add test for invalid month

* Render header in calendar item

* Header - render header

* fix CalendarItem render

* Create getDaysOfWeekNumber and dependencies

* radability

* Add context provider and change firstDayOfWeek to enum

* Add date and setDate to context

* Add getDateObject worklet

* Fix calendar context types and add initialDate prop

* Basic Agenda

* Header - add months by presing arrow buttons

* Add TODOs

* Move FirstDayOfWeek from enum to enum+union and fix tests

* MILLIS to MS

* Add mock data (script still needs work) and link (types need work)

* Fix script and types

* addMonth - use Date's setMonth function

* Moving 'firstDayOfWeek' to be enum

* WeekDaysNames - adding new component to Header

* add ts notes

* update comment for ts version ^4.3.2

* Set WeekDaysNames format in Header

* use FirstDayOfWeek enum

* use 'DayNamesFormat' enum

* remove console

* Day - adding onPress
Adding style.ts file
Calendar - pass date to calendatItem

* add todo

* Minor fixes and remove todos

* Change context's date to selectedDate

* remove style file

* valueOf to getTime

* export Event

* Day - adding selection

* Wrap CalendarItem with FlashList

* Agenda - add headers + scroll on date change

* Agenda - set date on scroll

* Fix mock and script

* UI touchups

* sort imports and add test for 'getMonthForIndex' and adding tests to 'isSameDay'

* Header - small ui changes

* Context - adding 'showWeeksNumbers'

* fix indentation

* margin

* Add TODOs

* Add flex to day

* Day - mark today

* Fix FirstDayOfWeek enum and add update sources

* Adding UpdateSource to setDate calls

* Implement setDate to store lastUpdateSource

* dateutils - adding 'isSameMonth'

* Add estimatedItemSize prop to FlashLists

* Update mock data

* Fix TS errors

* Context - add updateSource

* fix screen errors

* fix updateSource on Context

* fix type

* Calendar - add scrollToIndex on selectedDate change

* Agenda - verify update source and use isSameDay

* Calendar - fix scrollToIndex

* Agenda initial index

* isSameMonth - support MonthProps type for params

* remove synchronous calls to isNumber from a worklet

* Calendar - add setDate on calendar scroll (by user) to the first of the month

* Fix getWeekNumbersOfMonth and add missing tests

* Fix typing issues

* fix scrolledByUser.value

* Calendar -  fix  scrolledByUser

* merge fix

* shush ts wrannings

* Add todos

* DateUtils - add 'getNormalizedDate' function

* Change week numbering from ISO to default

Change week numbering to use "default" (Jan 1st) and not ISO (Jan 4th)

* DateUtils - adding 'isToday' and 'isPastDate'

* adding assets

* Agenda - fixed height for items and initialScrollIndex

* TodayButton

* Update calendars mock data

* Adding 'staticHeader' prop to calendar and passing it on context

* Fix lint

* HeaderHeight to context

* Utils - use JS Date only inside utils (not as a parameter nor return type) and fix tests to use our inner utils

* Fix tests and remove getNormalizedDate

* fix lint

* Calendar - setDate when 'initialDate' prop changes

* Header - fix arrows

* fix margins

* DateUtils - add 'getTimestamp' from DateObject

* fix extra days text color

* Adding 'showExtraDays' prop (currently only controls the text color)

* re export calendar in incubator

* Use useDidUpdate for setDate coming from props change

* Fix Android item scroll

* Day - fix extra days

* hide extraDays

* Day - fix inactive date selected

* fix CalendatItem default height

* Day - fix today background when inactive

* Header - arrow press - set day to be the first of the month

* demo screen - comment out unused

* CalendarProcessor - add past and future range and pass date as start point (other then today)

* DateUtils - add 'addYears' to a given date

* Day - sync color and backgroundColor animations

* Calendar - add infinite scroll

* move addPages up

* minor changes

* Simple POC for scrollable list with native interactions

* Add basic implementation of mock server

* Add mini example of AgendaList with animated scroll handler

* revert playgroundScren changes

* fix callback

* typo

* UpdateSource should not be optional or undefined

---------

Co-authored-by: Ethan Sharabi <[email protected]>
Co-authored-by: M-i-k-e-l <[email protected]>
* CharCounter now working with emojis (16-bit code)

* Fixed review notes
* fix wheelpicker in android

* Removed initialNumToRender, removed style

* removed itemLength variable

* opt-out

* added flatListProps to wheelPicker.api

* added note to the api.json file

* refactor the nore

* fixed note

* minor fix
Allow sending multiple params and allow (any) objects
* Incubator.Dialog - fix test after RN71 bug fix

* Forgot this
* Replacing 'react-native-text-size' with wix fork

* fix version
* Enable TS check on demo files and fix all errors

* Code review fixes

* Add space - test commit

* Remove space
* Move to reanimated 3

* Improve wording
@lidord-wix lidord-wix marked this pull request as draft May 15, 2023 14:39
@lidord-wix
Copy link
Contributor Author

@lidord-wix How the usage will look like? like this?

<View marginT--5/>

Yes :)

Hmm it's a little nasty, but I understand the requirement. Who requested it?

Btw, I thought about it a long time ago that the modifiers like margin/padding should be changed to numeric values to make them easier to pass something like

<View marginT={5} marginH={-5} />

I know it's a little out of scope, but do you think it's a big effort supporting this? It will also will typings.

I added this support to margin and padding modifiers, please don't merge it. let's talk about it in the dev sync :)

@stale
Copy link

stale bot commented Jul 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 15, 2023
@stale stale bot closed this Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants