From 849d3a1c43f6708168bed8caae2669d8e9610638 Mon Sep 17 00:00:00 2001 From: Leon Date: Wed, 4 Mar 2026 15:34:59 +0100 Subject: [PATCH] feat: loading text button --- src/components/BorderGradientButton.js | 18 +++++++++++++----- src/screens/Production/PlaybackDownload.js | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/BorderGradientButton.js b/src/components/BorderGradientButton.js index 7a066bc..7bccf1e 100644 --- a/src/components/BorderGradientButton.js +++ b/src/components/BorderGradientButton.js @@ -1,6 +1,6 @@ import { BlurView } from 'expo-blur' import React from 'react' -import { Image, Pressable, Text, View } from 'react-native' +import { ActivityIndicator, Image, Pressable, Text, View } from 'react-native' import { Palette, Style } from '../styles' import { FONT_FAMILY } from '../styles/Fonts' import { size as sizeStyle } from '../styles/Style' @@ -26,6 +26,8 @@ const BorderGradientButton = ({ containerStyle = {}, tint = 'dark', disabled = false, + loading = false, + loadingText = null, maxWidth = null, size = 'medium', height = null, @@ -34,16 +36,18 @@ const BorderGradientButton = ({ const buttonHeight = typeof height === 'number' ? height : HEIGHT_BY_SIZE[resolvedSize] const fontSize = FONT_SIZE_BY_SIZE[resolvedSize] const iconSize = resolvedSize === 'small' ? 14 : 16 + const isDisabled = disabled || loading + const label = loading && typeof loadingText === 'string' ? loadingText : title return ( - {icon && } + {loading ? ( + + ) : ( + icon && + )} - {title} + {label} diff --git a/src/screens/Production/PlaybackDownload.js b/src/screens/Production/PlaybackDownload.js index 857ac11..d13e843 100644 --- a/src/screens/Production/PlaybackDownload.js +++ b/src/screens/Production/PlaybackDownload.js @@ -501,6 +501,8 @@ const PlaybackDownload = ({ route }) => { handlePublish() }} disabled={isPublishing || !hasAcceptedPublication} + loading={isPublishing} + loadingText="Publication en cours..." containerStyle={styles.continueButton} />