new_header.tsx 806 B

1234567891011121314151617181920
  1. import { View, Text } from '@tarojs/components'
  2. import './new_header.scss'
  3. import { MainColorType } from '@/context/themes/color'
  4. import { rpxToPx } from '@/utils/tools'
  5. export enum NewHeaderType {
  6. center = 'center',
  7. center_subtitle = 'center_subtitle',
  8. left = 'left',
  9. left_subtitle = 'left_subtitle'
  10. }
  11. export default function NewHeader(props: { type: NewHeaderType, title: string, subtitle?: string }) {
  12. return <View className='new_header_bg'>
  13. <View className='h50 bold'>{props.title}</View>
  14. {
  15. (props.type == NewHeaderType.center_subtitle || props.type == NewHeaderType.left_subtitle) &&
  16. <View className='h30' style={{ color: MainColorType.g01,marginTop:rpxToPx(12) ,lineHeight:rpxToPx(45)+'px'}}>{props.subtitle}</View>
  17. }
  18. </View>
  19. }