Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Merge branch 'fix/create-style-api' of github.com:gluestack/gluestack…
Browse files Browse the repository at this point in the history
…-style into fix/create-style-api
  • Loading branch information
ankit-tailor committed Oct 6, 2023
2 parents de311d1 + 2c3e7a8 commit e2410a1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { Wrapper } from '../../components/Wrapper';
import { AnimatedView } from '@gluestack-style/animation-resolver';
import { CameraIcon } from 'lucide-react-native';

import Link from 'next/link';
import { Pressable } from 'react-native';
export const BaseIcon = styled(
AsForwarder,
{
Expand Down Expand Up @@ -114,11 +116,27 @@ const Text1 = styled(
}
);

const MyLink = styled(Link, {});
export function ContextBasedStyles() {
return (
<Wrapper colorMode="dark">
{/* <StyledIcon as={CameraIcon} /> */}
<Text1 data-style="hell">vdkbkdfbv</Text1>
{/* <Text1
// data-style="hell"
sx={{
color: '$red500',
}}
>
vdkbkdfbv
</Text1> */}
<MyLink
href={'/'}
sx={{
color: '$red500',
}}
>
next link
</MyLink>
</Wrapper>
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gluestack-style/react",
"description": "A universal & performant styling library for React Native, Next.js & React",
"version": "1.0.0-alpha.0",
"version": "1.0.0-alpha.1",
"keywords": [
"React Native",
"Next.js",
Expand Down
6 changes: 4 additions & 2 deletions packages/react/src/generateStylePropsFromCSSIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,13 @@ export function generateStylePropsFromCSSIds(
}

Object.assign(props, {
style: propsStyles ? [...styleObj, ...propsStyles] : styleObj,
dataSet: {
'style': propsStyles ? [...styleObj, ...propsStyles] : styleObj,
'dataSet': {
...props?.dataSet,
style: getDataStyle(props, styleCSSIdsString),
},
// DONOT REMOVE THIS LINE, THIS IS FOR SPECIFIC COMPONENTS LIKE next/link
'data-style': getDataStyle(props, styleCSSIdsString),
});
return props;
}

0 comments on commit e2410a1

Please sign in to comment.