NTP-12975 | button style fix (#14249)
This commit is contained in:
@@ -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} />;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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 &&
|
||||
|
||||
Reference in New Issue
Block a user