Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add animation to Segmented Button icons #4543

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Button.tsx
aravind3566 authored Nov 19, 2024
commit e57f88ce4e217d5ac4e966e9207d69bf09b4e805
8 changes: 1 addition & 7 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -130,10 +130,6 @@ export type Props = $Omit<React.ComponentProps<typeof Surface>, 'mode'> & {
* Specifies the largest possible scale a text font can reach.
*/
maxFontSizeMultiplier?: number;
/**
* Label text number Of Lines of the button.
*/
noOfLines?: number;
style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
/**
* Style for the button text.
@@ -190,7 +186,6 @@ const Button = (
onPressOut,
onLongPress,
delayLongPress,
noOfLines,
style,
theme: themeOverrides,
uppercase: uppercaseProp,
@@ -271,7 +266,6 @@ const Button = (

const borderRadius = (isV3 ? 5 : 1) * roundness;
const iconSize = isV3 ? 18 : 16;
const numberOfLines = noOfLines ? 1 : noOfLines;

const { backgroundColor, borderColor, textColor, borderWidth } =
getButtonColors({
@@ -389,7 +383,7 @@ const Button = (
<Text
variant="labelLarge"
selectable={false}
numberOfLines={numberOfLines}
numberOfLines={1}
testID={`${testID}-text`}
style={[
styles.label,