Skip to content

Commit

Permalink
feat: theme
Browse files Browse the repository at this point in the history
  • Loading branch information
maotoumao committed Aug 22, 2022
1 parent a92b50b commit 173e4b7
Show file tree
Hide file tree
Showing 6 changed files with 591 additions and 35 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
"nanoid": "^4.0.0",
"react": "18.0.0",
"react-native": "0.69.1",
"react-native-bootsplash": "^4.3.2",
"react-native-circular-progress-indicator": "^4.4.0",
"react-native-document-picker": "^8.1.1",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.5.0",
"react-native-get-random-values": "^1.8.0",
"react-native-image-colors": "^1.5.1",
"react-native-linear-gradient": "^2.6.2",
"react-native-logs": "^5.0.1",
"react-native-music-control": "^1.4.1",
Expand Down
49 changes: 25 additions & 24 deletions src/components/dialogs/components/simpleDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import {StyleSheet, Text, View} from 'react-native';
import rpx from '@/utils/rpx';
import { Button, Dialog, Paragraph } from 'react-native-paper';
import {Button, Dialog, Paragraph} from 'react-native-paper';
import useDialog from '../useDialog';

interface ISimpleDialogProps {

}
interface ISimpleDialogProps {}
export default function SimpleDialog(props: ISimpleDialogProps) {
const {dialogName, hideDialog, payload} = useDialog();
return (
const {dialogName, hideDialog, payload} = useDialog();
return (
<Dialog visible={dialogName === 'simple-dialog'} onDismiss={hideDialog}>
<Dialog.Title>{payload?.title}</Dialog.Title>
<Dialog.Content>
<Paragraph>{payload?.content}</Paragraph>
</Dialog.Content>
<Dialog.Actions>
<Button onPress={hideDialog}>取消</Button>
<Button onPress={() => {
payload?.onOk?.();
hideDialog();
}}>确认</Button>
</Dialog.Actions>
</Dialog>
);
<Dialog.Title>{payload?.title}</Dialog.Title>
<Dialog.Content>
<Paragraph>{payload?.content}</Paragraph>
</Dialog.Content>
<Dialog.Actions>
<Button onPress={hideDialog}>取消</Button>
<Button
onPress={() => {
payload?.onOk?.();
hideDialog();
}}>
确认
</Button>
</Dialog.Actions>
</Dialog>
);
}

const style = StyleSheet.create({
wrapper: {
width: rpx(750)
}
})
wrapper: {
width: rpx(750),
},
});
2 changes: 1 addition & 1 deletion src/components/musicBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function (props: IProps) {
<Pressable
style={[
style.wrapper,
{backgroundColor: Color(colors.primary).alpha(0.66).toString()},
{backgroundColor: Color(colors.surface).alpha(0.66).toString()},
]}
onPress={() => {
navigation.navigate(ROUTE_PATH.MUSIC_DETAIL);
Expand Down
2 changes: 1 addition & 1 deletion src/components/musicListItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ const style = StyleSheet.create({
title: {
fontSize: fontSizeConst.normal,
includeFontPadding: false,
maxWidth: rpx(480)
maxWidth: rpx(420)
}
});
5 changes: 3 additions & 2 deletions src/entry/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const DefaultTheme = {
text: '#333333',
placeholder: '#666666',
background: 'rgba(128,128,128,0.1)',
primary: '#cdd1d3'
primary: '#cdd1d3',
surface: '#cdd1d3',
}
}

Expand All @@ -31,7 +32,7 @@ const CustomTheme = {
text: '#dddddd',
placeholder: '#cccccc',
background: 'rgba(128,128,128,0.1)',
surface: '#ffffff44',
surface: '#2b333e',
backdrop: 'rgba(0,0,0,0.2)',
primary: "#2b333e",
accent: '#cdd1d3',
Expand Down
Loading

0 comments on commit 173e4b7

Please sign in to comment.