Skip to content
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

fix(Box):添加Box盒子组件和示例展示 #607

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion example/examples/src/routes/Typography/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import {View} from 'react-native';
import {H1, H2, H3, H4, H5, H6, S, Del, U, P, Strong, Br, Div, Hr, Em, RnText, Text} from '@uiw/react-native';
import {H1, H2, H3, H4, H5, H6, S, Del, U, P, Strong, Br, Div, Hr, Em, RnText, Text, Box} from '@uiw/react-native';
import {ComProps} from '../../routes';
import Layout, {Container} from '../../Layout';
const {Header, Body, Card, Footer} = Layout;
Expand Down Expand Up @@ -69,6 +69,11 @@ export default class TypographyView extends React.Component<TypographyViewProps>
}}
/>
</Card>
<Card title="盒子 <Box />">
<Box backgroundColor="primary_background">
<Text color="text">一段文本</Text>
</Box>
</Card>
</Body>
<Footer />
</Layout>
Expand Down
7 changes: 7 additions & 0 deletions packages/core/src/Typography/Box.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createBox } from '@shopify/restyle';
import { Theme } from '../theme';

const Box = createBox<Theme>();
Box.displayName = 'Box';

export default Box;
2 changes: 2 additions & 0 deletions packages/core/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export { default as Hr } from './Typography/Hr';
export { default as Em } from './Typography/Em';
export { default as RnText } from './Typography/RnText';
export { default as Text } from './Typography/Text';
export { default as Box } from './Typography/Box';

export * from './Typography/H1';
export * from './Typography/H2';
Expand All @@ -169,6 +170,7 @@ export * from './Typography/Hr';
export * from './Typography/Em';
export * from './Typography/RnText';
export * from './Typography/Text';
export * from './Typography/Box';

export { theme, ThemeProvider };
export type { Theme };