This repository has been archived by the owner on Dec 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #453 from gluestack/feat/create-config-style-api
Feat/create config style api
- Loading branch information
Showing
10 changed files
with
431 additions
and
204 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { resolveComponentThemes } from './createConfig'; | ||
|
||
export const createComponents = <T>(components: T): T => { | ||
return resolveComponentThemes({}, components); | ||
}; |
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,25 @@ | ||
import type { ViewProps, ImageProps, TextProps } from 'react-native'; | ||
import type { | ||
IComponentStyleConfig, | ||
ITheme, | ||
UnionToIntersection, | ||
} from './types'; | ||
|
||
export const createStyle = <T, Variants>( | ||
theme: T | ITheme<Variants, ViewProps | ImageProps | TextProps>, | ||
componentConfig?: Omit<IComponentStyleConfig, 'componentName'>, | ||
BUILD_TIME_PARAMS?: any | ||
) => { | ||
const createdStyles = { | ||
theme, | ||
componentConfig, | ||
BUILD_TIME_PARAMS, | ||
}; | ||
|
||
return createdStyles as { | ||
theme: UnionToIntersection< | ||
T | ITheme<Variants, ViewProps | ImageProps | TextProps> | ||
>; | ||
componentConfig?: Omit<IComponentStyleConfig, 'componentName'>; | ||
}; | ||
}; |
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