forked from maotoumao/MusicFree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
591 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.