Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/mobile/occupancy integration #287

Merged
merged 15 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions frontend/occupi-mobile-backup/screens/Login/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { Controller, useForm } from 'react-hook-form';
import { AlertTriangle, EyeIcon, EyeOffIcon } from 'lucide-react-native';
import { z } from 'zod';
import { zodResolver } from '@hookform/resolvers/zod';
import { Keyboard } from 'react-native';
import { Keyboard, KeyboardAvoidingView, Platform, ScrollView } from 'react-native';
// import { FacebookIcon, GoogleIcon } from './assets/Icons/Social';
import StyledExpoRouterLink from '../../components/StyledExpoRouterLink';
import { router } from 'expo-router';
Expand Down Expand Up @@ -161,14 +161,14 @@ const SignUpForm = () => {
};

return (
<>
<KeyboardAvoidingView>
<VStack justifyContent="space-between">
<FormControl
isInvalid={(!!errors.email || isEmailFocused) && !!errors.email}
isRequired={true}
>
<FormControlLabel mb="$1">
<FormControlLabelText fontWeight="$normal">Deloitte Email Address</FormControlLabelText>
<FormControlLabelText fontWeight="$normal">Deloitte Email Addss</FormControlLabelText>
</FormControlLabel>
<Controller
name="email"
Expand Down Expand Up @@ -418,7 +418,7 @@ const SignUpForm = () => {
text="Signup"
/>
)}
</>
</KeyboardAvoidingView>
);
};

Expand Down Expand Up @@ -509,14 +509,14 @@ function SignUpFormComponent() {

export default function SignUp() {
return (
<View flex="$1" pt="$12" backgroundColor='white'>
<ScrollView>
<View pt="$12" backgroundColor='white'>
<Box
sx={{
'@md': {
display: 'flex',
},
}}
flex={1}
display="none"
>
{/* <SideContainerWeb /> */}
Expand All @@ -525,5 +525,6 @@ export default function SignUp() {
<SignUpFormComponent />
</Box>
</View>
{/* // </ScrollView> */}
);
}
69 changes: 69 additions & 0 deletions frontend/occupi-mobile4/components/LineGraph.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React, { useEffect, useState } from 'react'
import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen';
import {
View,
} from '@gluestack-ui/themed';
import * as SecureStore from 'expo-secure-store';
import { LineChart } from "react-native-gifted-charts"
import { useColorScheme } from 'react-native';
import { useTheme } from './ThemeContext';

const LineGraph = (data) => {
const colorscheme = useColorScheme();
const { theme } = useTheme();
const currentTheme = theme === "system" ? colorscheme : theme;
// console.log(data.data);
const labels = currentTheme === 'dark' ? "lightgray" : "darkgrey";
const [accentColour, setAccentColour] = useState<string>('greenyellow');
useEffect(() => {
const getAccentColour = async () => {
let accentcolour = await SecureStore.getItemAsync('accentColour');
setAccentColour(accentcolour);
};
getAccentColour();
}, []);
return (
<View
style={{ width: wp('100%'), height: hp('35%'), flexDirection: 'column' }}
// style={{
// // marginVertical: 100,
// paddingVertical: 20,
// backgroundColor: '#414141',
// }}
>
<LineChart
isAnimated
width={wp('80%')}
thickness={3}
color={accentColour}
maxValue={5}
noOfSections={5}
// hideRules
animateOnDataChange
animationDuration={1000}
onDataChangeAnimationDuration={300}
areaChart
endSpacing={0}
yAxisTextStyle={{color: labels}}
xAxisLabelTextStyle={{color: labels}}
data={data.data}
hideDataPoints
startFillColor={accentColour}
endFillColor={accentColour}
startOpacity={0.5}
endOpacity={0.1}
spacing={47}
backgroundColor={currentTheme === 'dark' ? "#414141" : "white"}
// showVerticalLines
// verticalLinesColor="rgba(14,164,164,0.5)"
// rulesColor="gray"
rulesType="dashed"
initialSpacing={20}
yAxisColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"}
xAxisColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"}
/>
</View>
)
}

export default LineGraph
Loading
Loading