Skip to content

Commit

Permalink
fix(DragDrawer): 明暗主题色调整
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenlingasMx authored and hy committed Apr 10, 2023
1 parent dc16dac commit 020e463
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
26 changes: 12 additions & 14 deletions example/examples/src/routes/DragDrawer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useState, Fragment} from 'react';
import {View, Text, FlatList, ListRenderItemInfo} from 'react-native';
import {DragDrawer, Card, Icon, List} from '@uiw/react-native';
import React, {Fragment} from 'react';
import {View, FlatList, ListRenderItemInfo} from 'react-native';
import {DragDrawer, Text} from '@uiw/react-native';
import Layout, {Container} from '../../Layout';
import {ComProps} from '../../routes';
const {Header, Body, Footer} = Layout;
Expand All @@ -13,11 +13,11 @@ export default function DragDrawerView({route}: DragDrawerViewProps) {
const description = route.params.description;
const title = route.params.title;

const renderItem = ({item}: ListRenderItemInfo<Number>) => (
<View
style={{borderWidth: 0.5, padding: 10, borderColor: '#D9D9D9'}}
key={item + ''}>
<Text style={{fontSize: 20, textAlign: 'center'}}>{item}</Text>
const renderItem = ({item}: any) => (
<View style={{borderWidth: 0.5, padding: 10, borderColor: '#D9D9D9'}} key={item + ''}>
<Text color="text" style={{fontSize: 20, textAlign: 'center'}}>
{item}
</Text>
</View>
);
return (
Expand All @@ -27,15 +27,13 @@ export default function DragDrawerView({route}: DragDrawerViewProps) {
// drawerBackgroundColor='lightblue' //抽屉背景
// icon={<Icon name="smile" fill="red" size={30} />} //自定义拖曳图标
>
<FlatList
data={data}
renderItem={renderItem}
keyExtractor={item => item + ''}
/>
<FlatList data={data} renderItem={renderItem} keyExtractor={item => item + ''} />
</DragDrawer>
<Container>
<Layout>
<Header title={title} description={description} />
<Body>
<Header title={title} description={description} />
</Body>
</Layout>
</Container>
</Fragment>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/DragDrawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface DragDrawerProps extends ViewProps {

function DragDrawer(props: DragDrawerProps) {
const theme = useTheme<Theme>();
const { drawerBackgroundColor = theme.colors.white || '#fff', drawerHeight = 300, children, icon, style } = props;
const { drawerBackgroundColor = theme.colors.mask || '#fff', drawerHeight = 300, children, icon, style } = props;

const [animatedViewHeight, setAnimatedViewHeight] = useState(new Animated.Value(drawerHeight));
const [viewHeight, setViewHeight] = useState(drawerHeight);
Expand Down

0 comments on commit 020e463

Please sign in to comment.