aboutsummaryrefslogtreecommitdiff
path: root/src/components/moments/IndividualMomentTitleBar.tsx
blob: c6bf14232cafa72cdbf1360ff1794e08d1b6b75c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React from 'react';
import {StyleSheet, Text, View, ViewProps} from 'react-native';
import {normalize, SCREEN_WIDTH} from '../../utils';

interface IndividualMomentTitleBarProps extends ViewProps {
  title: string;
}
const IndividualMomentTitleBar: React.FC<IndividualMomentTitleBarProps> = ({
  title,
}) => {
  return (
    <View style={styles.mainContainer}>
      <View style={styles.titleContainer}>
        <Text
          style={[
            styles.title,
            {
              fontSize: title.length > 18 ? normalize(14) : normalize(16),
            },
          ]}>
          {title}
        </Text>
      </View>
    </View>
  );
};

const styles = StyleSheet.create({
  title: {
    textAlign: 'center',
    color: 'white',
    fontSize: normalize(18),
    fontWeight: '700',
    lineHeight: normalize(21.48),
    letterSpacing: normalize(1.3),
  },
  titleContainer: {
    width: '80%',
    position: 'absolute',
    left: '10%',
    right: '10%',
    height: normalize(70),
  },
  mainContainer: {
    flex: 1,
    width: SCREEN_WIDTH * 0.6,
    flexDirection: 'row',
    justifyContent: 'flex-end',
    marginVertical: '2%',
  },
});

export default IndividualMomentTitleBar;