NTP-12975 | button style fix (#14249)

This commit is contained in:
Somarapu Vamshi
2024-12-18 21:35:15 +05:30
committed by GitHub
parent 300bc538c4
commit 68b09ed4af
3 changed files with 23 additions and 8 deletions

View File

@@ -1,26 +1,33 @@
import { View } from "react-native";
import { styles } from "./SelectButtonStyles";
import { View, ViewStyle } from "react-native";
import { SelectButtonType } from "../../../App/common/constants";
import { styles } from "./SelectButtonStyles";
interface SelectButtonProps {
selected?: boolean;
type?: string;
buttonStyle?: ViewStyle;
}
const RadioButton = ({ selected }: SelectButtonProps) => {
const RadioButton = ({ selected, buttonStyle }: SelectButtonProps) => {
return (
<View style={[styles.radioButton, selected && styles.selectedRadioButton]}>
<View
style={[
styles.radioButton,
buttonStyle,
selected && styles.selectedRadioButton,
]}
>
{selected && <View style={styles.innerRadio} />}
</View>
);
};
const SelectButton = ({ selected, type }: SelectButtonProps) => {
const SelectButton = ({ selected, type, buttonStyle }: SelectButtonProps) => {
switch (type) {
case SelectButtonType.RADIO:
return <RadioButton selected={selected} />;
return <RadioButton selected={selected} buttonStyle={buttonStyle} />;
default:
return <RadioButton selected={selected} />;
return <RadioButton selected={selected} buttonStyle={buttonStyle} />;
}
};

View File

@@ -9,6 +9,7 @@ import {
CardFooterCtaButtonProps,
ItemCardProps,
} from "../../../App/common/interface/widgets/widgetData";
import { commonStyles } from "../../../App/Container/Navi-Insurance/Styles";
import { SelectButton } from "../../reusable";
import CtaButton from "../../reusable/cta-button/CtaButton";
import GradientBorder from "../../reusable/gradient-border/GradientBorder";
@@ -78,7 +79,11 @@ export const ItemCardWithTag = ({
)}
</View>
</View>
<SelectButton selected={selected} type={SelectButtonType.RADIO} />
<SelectButton
selected={selected}
type={SelectButtonType.RADIO}
buttonStyle={commonStyles.marginRight0}
/>
</View>
{item?.tag &&