{"size": 2769, "ext": "js", "max_stars_repo_path": "project/client/screens/ProfileScreen.js", "max_stars_repo_name": "Only-in-Dreams/Maintenance-Ticket-Software", "max_stars_repo_stars_event_min_datetime": "2020-07-13T20:46:39.000Z", "max_stars_repo_stars_event_max_datetime": "2020-07-13T20:46:39.000Z", "max_issues_repo_path": "project/client/screens/ProfileScreen.js", "max_issues_repo_name": "Only-in-Dreams/Maintenance-Ticket-Software", "max_issues_repo_issues_event_min_datetime": "2021-09-02T13:56:43.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-19T05:01:21.000Z", "max_forks_repo_path": "project/client/screens/ProfileScreen.js", "max_forks_repo_name": "Only-in-Dreams/Maintenance-Ticket-Software", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 26.3714285714, "max_line_length": 89, "alphanum_fraction": 0.6500541712}
import * as React from 'react';
import { Image, Platform, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { ScrollView } from 'react-native-gesture-handler';
import * as WebBrowser from 'expo-web-browser';
import { userStore, colorScheme } from '../stores';
import Colors from '../constants/Colors'

import { MonoText } from '../components/StyledText';
import User from '../data/User';

export default function ProfileScreen(properties) {

  // if (!userStore.loggedIn) properties.navigation.replace('Root');

  let themeContainer =
    colorScheme.theme === 'light' ? styles.iosLightContainer : styles.iosDarkContainer;
  let themeLargeTitle =
    colorScheme.theme === 'light' ? styles.lightLargeTitle : styles.darkLargeTitle;
  let themeBodyText =
    colorScheme.theme === 'light' ? styles.iosLightThemeText : styles.iosDarkThemeText;
  let themeItem =
    colorScheme.theme === 'light' ? Colors.white : Colors.iosDarkTable;
  let themeSeparator =
    colorScheme.theme === 'light' ? Colors.iosLightSeparator : Colors.iosDarkSeparator;

  // TODO: Check for valid session and then load user values
  // from UserStore if it exists and if session is valid
  // otherwise redirect to login page
  let testUser = {
    first: "Mary",
    last: "Sue",
    email: "someday@somepl.ace",
    phone: "123-456-7890",
    contactPreference: "text",
    entryPermission: "notify",
    note: "The dog definitely bites."
  };
  let testUser2 = {
    first: userStore.first,
    last: userStore.last,
    email: userStore.email,
    phone: userStore.phone + '',
    contactPreference: userStore.contactPreference,
    entryPermission: userStore.entryPermission,
    note: userStore.note || '',
  };
  console.log(testUser2);
  return (
    <View style={styles.container, themeContainer}>
      <ScrollView>
        <View>
          <User {...testUser2}/>
        </View>
      </ScrollView>
    </View>
  );
}

ProfileScreen.navigationOptions = {
  header: null,
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  iosLightContainer: {
    flex: 1,
    backgroundColor: Colors.white,
  },
  iosLightThemeText: {
    color: Colors.black
  },
  iosDarkContainer: {
    flex: 1,
    backgroundColor: Colors.black,
  },
  iosDarkThemeText: {
    color: Colors.white
  },
  tabBarInfoContainer: {
    position: 'absolute',
    bottom: 0,
    left: 0,
    right: 0,
    ...Platform.select({
      ios: {
        shadowColor: 'black',
        shadowOffset: { width: 0, height: -3 },
        shadowOpacity: 0.1,
        shadowRadius: 3,
      },
      android: {
        elevation: 20,
      },
    }),
    alignItems: 'center',
    backgroundColor: '#fbfbfb',
    paddingVertical: 20,
  },
  navigationFilename: {
    marginTop: 5,
  },
});
