| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- /**
- * 站点标签组件
- * @邠心vbe on 2023/11/30
- */
- import React from 'react';
- import { StyleSheet } from 'react-native';
- import TextView from './TextView';
- const SiteLabelView = ({
- label,
- color = textLight,
- version=1,
- background = colorPrimary
- }) => {
- if (label) {
- return (
- <TextView
- style={[
- version == 2
- ? style.textV2
- : style.textV1,
- {
- color: color || textLight,
- backgroundColor: background || colorPrimary
- }
- ]}>
- {label}
- </TextView>
- )
- } else {
- return <></>
- }
- };
- export default SiteLabelView;
- const style = StyleSheet.create({
- textV1: {
- height: 22,
- fontSize: 12,
- marginRight: 5,
- marginBottom: 5,
- borderRadius: 3,
- ...$padding(0, 6)
- },
- textV2: {
- height: 20,
- fontSize: 8,
- marginRight: 6,
- borderRadius: 30,
- ...$padding(0, 10)
- }
- })
|