Skip to content

Commit

Permalink
Release (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mym0404 committed Mar 14, 2024
2 parents 52827b9 + 4dfa1cc commit 925863f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doc/docs/usage/component.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ type StyledScrollViewProps = PropsWithChildren<
>;
const StyledScrollView = forwardRef((props: StyledScrollViewProps, ref: Ref<ScrollView>) => {
const { viewStyle, filteredProps } = useSx(props);
const { viewStyle: contentContainerStyle } = useSx(props.contentContainerSx ?? {});
const { viewStyle: contentContainerStyle } = useSx(props.contentContainerSx);
return (
<ScrollView ref={ref} style={viewStyle()} contentContainerStyle={contentContainerStyle()} {...filteredProps} />
);
Expand Down
2 changes: 1 addition & 1 deletion doc/i18n/ko/docusaurus-plugin-content-docs/current.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"description": "The label for category Usage in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Usage.link.generated-index.description": {
"message": "Learn the most important concepts.",
"message": "React Native Styled System의 개념들을 빠르게 배워보세요.",
"description": "The generated-index page description for category Usage in sidebar tutorialSidebar"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ type StyledScrollViewProps = PropsWithChildren<
>;
const StyledScrollView = forwardRef((props: StyledScrollViewProps, ref: Ref<ScrollView>) => {
const { viewStyle, filteredProps } = useSx(props);
const { viewStyle: contentContainerStyle } = useSx(props.contentContainerSx ?? {});
const { viewStyle: contentContainerStyle } = useSx(props.contentContainerSx);
return (
<ScrollView ref={ref} style={viewStyle()} contentContainerStyle={contentContainerStyle()} {...filteredProps} />
);
Expand Down
8 changes: 4 additions & 4 deletions doc/i18n/ko/docusaurus-theme-classic/footer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"link.title.Docs": {
"message": "Docs",
"message": "문서",
"description": "The title of the footer links column with title=Docs in the footer"
},
"link.title.More": {
"message": "More",
"message": "더보기",
"description": "The title of the footer links column with title=More in the footer"
},
"link.item.label.Tutorial": {
"message": "Tutorial",
"message": "튜토리얼",
"description": "The label of footer link with label=Tutorial linking to /docs/intro"
},
"link.item.label.GitHub": {
"message": "GitHub",
"message": "깃허브",
"description": "The label of footer link with label=GitHub linking to https://github.com/mj-studio-library/react-native-styled-system"
},
"copyright": {
Expand Down
6 changes: 3 additions & 3 deletions doc/i18n/ko/docusaurus-theme-classic/navbar.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"description": "The title in the navbar"
},
"logo.alt": {
"message": "My Site Logo",
"message": "로고",
"description": "The alt text of navbar logo"
},
"item.label.Tutorial": {
"message": "Tutorial",
"message": "튜토리얼",
"description": "Navbar item with label Tutorial"
},
"item.label.GitHub": {
"message": "GitHub",
"message": "깃허브",
"description": "Navbar item with label GitHub"
}
}
7 changes: 7 additions & 0 deletions src/hook/useSx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ describe('simple usages', () => {
});

describe('edge case', () => {
it('invalid px suffix', () => {
expectResult(baseTheme, { w: 'undefinedpx' as any }, {});
expectResult(baseTheme, { w: 'nullpx' as any }, {});
expectResult(baseTheme, { w: '-px' as any }, {});
expectResult(baseTheme, { w: '-1px' as any }, { width: -1 });
});

it('if token is undefined, baseStyle is returned', () => {
expectResult(undefined as any, {}, {});
expectResult(undefined as any, { style: { width: 1 } }, { width: 1 });
Expand Down
9 changes: 9 additions & 0 deletions src/util/propsToThemedStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export const propsToThemedStyle = ({
if (is.number(px)) {
return px;
}
// end with px but not number parsed
if (is.string(token) && token.endsWith('px')) {
return;
}

const spaces = theme.space;

Expand Down Expand Up @@ -121,6 +125,11 @@ export const propsToThemedStyle = ({
return px;
}

// end with px but not number parsed
if (is.string(token) && token.endsWith('px')) {
return;
}

const sizes = theme.sizes;

if ((is.string(token) || is.number(token)) && token in sizes) {
Expand Down

0 comments on commit 925863f

Please sign in to comment.