feat: fixes and formatter
This commit is contained in:
+10
-15
@@ -1,24 +1,19 @@
|
||||
import { Motion } from "@legendapp/motion";
|
||||
import { Motion } from '@legendapp/motion'
|
||||
|
||||
import { Fonts, Palette, Style } from "../styles";
|
||||
import { Fonts, Palette, Style } from '../styles'
|
||||
|
||||
const Badge = ({
|
||||
count = 0,
|
||||
size = 20,
|
||||
customContent = null,
|
||||
backgroundColor = null,
|
||||
} = {}) => {
|
||||
const Badge = ({ count = 0, size = 20, customContent = null, backgroundColor = null } = {}) => {
|
||||
if (!count && !customContent) {
|
||||
return null;
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<Motion.View
|
||||
animate={{ scale: 1 }}
|
||||
initial={{ scale: 0 }}
|
||||
transition={{ type: "tween", duration: 0.5 }}
|
||||
transition={{ type: 'tween', duration: 0.5 }}
|
||||
style={{
|
||||
position: "absolute",
|
||||
position: 'absolute',
|
||||
top: -size / 4,
|
||||
right: -size / 4,
|
||||
backgroundColor: backgroundColor || Palette.red,
|
||||
@@ -34,7 +29,7 @@ const Badge = ({
|
||||
<Motion.Text
|
||||
animate={{ scale: 1 }}
|
||||
initial={{ scale: 0 }}
|
||||
transition={{ type: "tween", duration: 0.5 }}
|
||||
transition={{ type: 'tween', duration: 0.5 }}
|
||||
style={{
|
||||
...Fonts({ color: Palette.white }),
|
||||
}}
|
||||
@@ -43,7 +38,7 @@ const Badge = ({
|
||||
</Motion.Text>
|
||||
)}
|
||||
</Motion.View>
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
|
||||
export default Badge;
|
||||
export default Badge
|
||||
|
||||
Reference in New Issue
Block a user