-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cmartins-loadCategories
- Loading branch information
Showing
61 changed files
with
590 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Check e2e test code builds correctly | ||
|
||
on: | ||
workflow_call: | ||
pull_request: | ||
types: [opened, synchronize] | ||
paths: | ||
- 'tests/e2e/**' | ||
- 'src/libs/E2E/**' | ||
|
||
jobs: | ||
lint: | ||
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: ./.github/actions/composite/setupNode | ||
|
||
- name: Verify e2e tests compile correctly | ||
run: npm run e2e-test-runner-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import type {ForwardedRef, ReactNode} from 'react'; | ||
import React, {forwardRef} from 'react'; | ||
import {View} from 'react-native'; | ||
import type {EdgeInsets, useSafeAreaFrame as LibUseSafeAreaFrame, WithSafeAreaInsetsProps} from 'react-native-safe-area-context'; | ||
import type ChildrenProps from '@src/types/utils/ChildrenProps'; | ||
|
||
type SafeAreaProviderProps = ChildrenProps; | ||
type SafeAreaConsumerProps = { | ||
children?: (insets: EdgeInsets) => ReactNode; | ||
}; | ||
type SafeAreaInsetsContextValue = { | ||
Consumer: (props: SafeAreaConsumerProps) => ReactNode; | ||
}; | ||
|
||
const insets: EdgeInsets = { | ||
top: 0, | ||
right: 0, | ||
bottom: 0, | ||
left: 0, | ||
}; | ||
|
||
function withSafeAreaInsets(WrappedComponent: React.ComponentType<WithSafeAreaInsetsProps & {ref: ForwardedRef<unknown>}>) { | ||
function WithSafeAreaInsets(props: WithSafeAreaInsetsProps & {forwardedRef: React.ForwardedRef<unknown>}) { | ||
return ( | ||
<WrappedComponent | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
// eslint-disable-next-line react/prop-types | ||
ref={props.forwardedRef} | ||
insets={insets} | ||
/> | ||
); | ||
} | ||
|
||
const WithSafeAreaInsetsWithRef = forwardRef((props: WithSafeAreaInsetsProps, ref: ForwardedRef<unknown>) => ( | ||
<WithSafeAreaInsets | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
forwardedRef={ref} | ||
/> | ||
)); | ||
|
||
return WithSafeAreaInsetsWithRef; | ||
} | ||
|
||
const SafeAreaView = View; | ||
const SafeAreaProvider = (props: SafeAreaProviderProps) => props.children; | ||
const SafeAreaConsumer = (props: SafeAreaConsumerProps) => props.children?.(insets); | ||
const SafeAreaInsetsContext: SafeAreaInsetsContextValue = { | ||
Consumer: SafeAreaConsumer, | ||
}; | ||
|
||
const useSafeAreaFrame: jest.Mock<ReturnType<typeof LibUseSafeAreaFrame>> = jest.fn(() => ({ | ||
x: 0, | ||
y: 0, | ||
width: 390, | ||
height: 844, | ||
})); | ||
const useSafeAreaInsets: jest.Mock<EdgeInsets> = jest.fn(() => insets); | ||
|
||
export {SafeAreaProvider, SafeAreaConsumer, SafeAreaInsetsContext, withSafeAreaInsets, SafeAreaView, useSafeAreaFrame, useSafeAreaInsets}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.