feat: fixes and formatter
This commit is contained in:
@@ -1,40 +1,39 @@
|
||||
import React from "react";
|
||||
import { Image, Pressable, Text } from "react-native";
|
||||
import { Palette, Style } from "../styles";
|
||||
import { FONT_FAMILY } from "../styles/Fonts";
|
||||
import { size } from "../styles/Style";
|
||||
import { LinearGradient } from "./LinearGradient/LinearGradient";
|
||||
import React from 'react'
|
||||
import { Image, Pressable, Text } from 'react-native'
|
||||
import { Palette, Style } from '../styles'
|
||||
import { FONT_FAMILY } from '../styles/Fonts'
|
||||
import { size } from '../styles/Style'
|
||||
import { LinearGradient } from './LinearGradient/LinearGradient'
|
||||
|
||||
const HEIGHT_BY_SIZE = {
|
||||
small: 44,
|
||||
medium: 50,
|
||||
large: 58,
|
||||
};
|
||||
}
|
||||
|
||||
const FONT_SIZE_BY_SIZE = {
|
||||
small: 14,
|
||||
medium: 15,
|
||||
large: 17,
|
||||
};
|
||||
}
|
||||
|
||||
const GradientButton = ({
|
||||
title = "",
|
||||
colors = ["#F94697", "#7023F7"],
|
||||
title = '',
|
||||
colors = ['#F94697', '#7023F7'],
|
||||
onPress,
|
||||
props,
|
||||
containerStyle = {},
|
||||
icon,
|
||||
disabled = false,
|
||||
maxWidth = null,
|
||||
size = "medium",
|
||||
size = 'medium',
|
||||
textStyle = {},
|
||||
gradientStyle = {},
|
||||
height = null,
|
||||
}) => {
|
||||
const resolvedSize = HEIGHT_BY_SIZE[size] ? size : "medium";
|
||||
const buttonHeight =
|
||||
typeof height === "number" ? height : HEIGHT_BY_SIZE[resolvedSize];
|
||||
const fontSize = FONT_SIZE_BY_SIZE[resolvedSize];
|
||||
const resolvedSize = HEIGHT_BY_SIZE[size] ? size : 'medium'
|
||||
const buttonHeight = typeof height === 'number' ? height : HEIGHT_BY_SIZE[resolvedSize]
|
||||
const fontSize = FONT_SIZE_BY_SIZE[resolvedSize]
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
@@ -79,7 +78,7 @@ const GradientButton = ({
|
||||
</Text>
|
||||
</LinearGradient>
|
||||
</Pressable>
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
|
||||
export default GradientButton;
|
||||
export default GradientButton
|
||||
|
||||
Reference in New Issue
Block a user