From 0708690fac1a6da773aebd6e1776ff4c96968769 Mon Sep 17 00:00:00 2001 From: Lahiru Gunathilake Date: Thu, 1 Feb 2024 21:20:13 +0530 Subject: [PATCH 1/3] Updated the styles --- src/styles.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/styles.js b/src/styles.js index cf010ea..2f1c1cf 100644 --- a/src/styles.js +++ b/src/styles.js @@ -20,7 +20,6 @@ const styles = StyleSheet.create({ contentContainer: { maxWidth: '80%', borderRadius: 5, - backgroundColor: 'white', padding: 10 }, content: { From 2d39e73097e62cbc98eb06de1049bbade8a046d5 Mon Sep 17 00:00:00 2001 From: Lahiru Gunathilake Date: Thu, 1 Feb 2024 21:40:55 +0530 Subject: [PATCH 2/3] Updated to edit the background color of the alert --- __tests__/props.js | 4 +++- src/AwesomeAlert.js | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/__tests__/props.js b/__tests__/props.js index 85bf9f7..1c4e344 100644 --- a/__tests__/props.js +++ b/__tests__/props.js @@ -10,6 +10,7 @@ const cancelText = "Dismiss"; const confirmText = "Confirm"; const cancelButtonColor = "#D0D0D0"; const confirmButtonColor = "#AEDEF4"; +const contentContainerColor = "white" const props = { show, @@ -23,7 +24,8 @@ const props = { cancelText, confirmText, cancelButtonColor, - confirmButtonColor + confirmButtonColor, + contentContainerColor }; export default props; diff --git a/src/AwesomeAlert.js b/src/AwesomeAlert.js index 9977d01..7062ece 100644 --- a/src/AwesomeAlert.js +++ b/src/AwesomeAlert.js @@ -137,6 +137,7 @@ export default class AwesomeAlert extends Component { const { alertContainerStyle, + contentContainerColor, overlayStyle, progressSize, progressColor, @@ -156,6 +157,10 @@ export default class AwesomeAlert extends Component { onPress: onCancelPressed, }; + const containerBackground = { + backgroundColor: contentContainerColor, + }; + const confirmButtonData = { testID: confirmButtonTestID, text: confirmText, @@ -168,10 +173,10 @@ export default class AwesomeAlert extends Component { return ( - + {showProgress ? ( @@ -245,6 +250,7 @@ AwesomeAlert.propTypes = { showConfirmButton: PropTypes.bool, cancelText: PropTypes.string, confirmText: PropTypes.string, + contentContainerColor: PropTypes.string, cancelButtonColor: PropTypes.string, confirmButtonColor: PropTypes.string, onCancelPressed: PropTypes.func, @@ -272,6 +278,7 @@ AwesomeAlert.defaultProps = { confirmText: 'Confirm', cancelButtonColor: '#D0D0D0', confirmButtonColor: '#AEDEF4', + contentContainerColor: "#FFFFFF", customView: null, modalProps: {}, cancelButtonTestID: 'awesome-alert-cancel-btn', From d912ab7f9386d475fc595c8e774c7df4a9fb8863 Mon Sep 17 00:00:00 2001 From: Lahiru Gunathilake Date: Thu, 1 Feb 2024 21:55:12 +0530 Subject: [PATCH 3/3] Updated the readme file --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c78fc04..f1aab39 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ export default class App extends React.Component { cancelText="No, cancel" confirmText="Yes, delete it" confirmButtonColor="#DD6B55" + contentContainerColor="#F8F8F8" onCancelPressed={() => { this.hideAlert(); }} @@ -149,6 +150,7 @@ const styles = StyleSheet.create({ | actionContainerStyle | `object` | Action container style | - | | cancelButtonColor | `string` | Background color | #D0D0D0 | | confirmButtonColor | `string` | Background color | #AEDEF4 | +| contentContainerColor | `string` | Background color | #FFFFFF | | cancelButtonStyle | `object` | Cancel button style | - | | cancelButtonTextStyle | `object` | Cancel button text style | - | | confirmButtonStyle | `object` | Confirm button style | - |