mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-16 23:12:12 +00:00
Added tip for error message
This commit is contained in:
parent
cbc9fc4fa6
commit
0453b9b9c1
3 changed files with 25 additions and 3 deletions
|
|
@ -21,6 +21,7 @@ interface CustomAlertProps {
|
|||
visible: boolean;
|
||||
title: string;
|
||||
message: string;
|
||||
subtitle?: string;
|
||||
onClose: () => void;
|
||||
actions?: Array<{
|
||||
label: string;
|
||||
|
|
@ -33,6 +34,7 @@ export const CustomAlert = ({
|
|||
visible,
|
||||
title,
|
||||
message,
|
||||
subtitle,
|
||||
onClose,
|
||||
actions = [
|
||||
{ label: 'OK', onPress: onClose }
|
||||
|
|
@ -110,6 +112,13 @@ export const CustomAlert = ({
|
|||
{message}
|
||||
</Text>
|
||||
|
||||
{/* Subtitle / tooltip */}
|
||||
{subtitle ? (
|
||||
<Text style={styles.subtitle}>
|
||||
{subtitle}
|
||||
</Text>
|
||||
) : null}
|
||||
|
||||
{/* Actions */}
|
||||
<View style={[
|
||||
styles.actionsRow,
|
||||
|
|
@ -200,11 +209,19 @@ const styles = StyleSheet.create({
|
|||
message: {
|
||||
color: '#AAAAAA',
|
||||
fontSize: 15,
|
||||
marginBottom: 24,
|
||||
marginBottom: 8,
|
||||
textAlign: 'center',
|
||||
lineHeight: 22,
|
||||
letterSpacing: 0.1,
|
||||
},
|
||||
subtitle: {
|
||||
color: '#666666',
|
||||
fontSize: 12,
|
||||
marginBottom: 24,
|
||||
textAlign: 'center',
|
||||
lineHeight: 18,
|
||||
letterSpacing: 0.1,
|
||||
},
|
||||
actionsRow: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'flex-end',
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ export const StreamsScreen = () => {
|
|||
alertVisible,
|
||||
alertTitle,
|
||||
alertMessage,
|
||||
alertSubtitle,
|
||||
alertActions,
|
||||
openAlert,
|
||||
closeAlert,
|
||||
|
|
@ -206,6 +207,7 @@ export const StreamsScreen = () => {
|
|||
visible={alertVisible}
|
||||
title={alertTitle}
|
||||
message={alertMessage}
|
||||
subtitle={alertSubtitle}
|
||||
actions={alertActions}
|
||||
onClose={closeAlert}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ export const useStreamsScreen = () => {
|
|||
const [alertVisible, setAlertVisible] = useState(false);
|
||||
const [alertTitle, setAlertTitle] = useState('');
|
||||
const [alertMessage, setAlertMessage] = useState('');
|
||||
const [alertSubtitle, setAlertSubtitle] = useState('');
|
||||
const [alertActions, setAlertActions] = useState<AlertAction[]>([]);
|
||||
|
||||
// Loading and provider state
|
||||
|
|
@ -174,12 +175,13 @@ export const useStreamsScreen = () => {
|
|||
|
||||
// Open alert helper
|
||||
const openAlert = useCallback(
|
||||
(title: string, message: string, actions?: AlertAction[]) => {
|
||||
(title: string, message: string, actions?: AlertAction[], subtitle?: string) => {
|
||||
if (!isMounted.current) return;
|
||||
|
||||
try {
|
||||
setAlertTitle(title);
|
||||
setAlertMessage(message);
|
||||
setAlertSubtitle(subtitle ?? '');
|
||||
setAlertActions(actions && actions.length > 0 ? actions : [{ label: 'OK', onPress: () => { } }]);
|
||||
setAlertVisible(true);
|
||||
} catch (error) {
|
||||
|
|
@ -465,7 +467,7 @@ export const useStreamsScreen = () => {
|
|||
|
||||
// Block magnet links
|
||||
if (typeof stream.url === 'string' && stream.url.startsWith('magnet:')) {
|
||||
openAlert('Not supported', 'Torrent streaming is not supported yet.');
|
||||
openAlert('Not supported', 'Torrent streaming is not supported yet.', undefined, 'You need a Debrid provider.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1145,6 +1147,7 @@ export const useStreamsScreen = () => {
|
|||
alertVisible,
|
||||
alertTitle,
|
||||
alertMessage,
|
||||
alertSubtitle,
|
||||
alertActions,
|
||||
openAlert,
|
||||
closeAlert,
|
||||
|
|
|
|||
Loading…
Reference in a new issue