Skip to content

Commit

Permalink
Merge branch 'main' into SCRUM-21-portfolio-screen-2
Browse files Browse the repository at this point in the history
  • Loading branch information
abby-stevenson committed Dec 3, 2024
2 parents 96232e6 + c647dbe commit 364dcbc
Show file tree
Hide file tree
Showing 82 changed files with 4,322 additions and 3,665 deletions.
5 changes: 3 additions & 2 deletions backend/supabase/seed.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- SQLBook: Code
INSERT INTO
auth.users (
instance_id,
Expand Down Expand Up @@ -108,8 +109,8 @@ INSERT INTO developers (id, name, description, premise, street, locality, state,
INSERT INTO developers (id, name, description, premise, street, locality, state, zipcode) VALUES ('c2128c81-e4db-4695-8be7-089f12d5ea46', 'Developer 1', 'Developer 1 description', '7', 'Speare Pl', 'Boston', 'MA', '02115');
INSERT INTO developers (id, name, description, premise, street, locality, state, zipcode) VALUES ('56ebee48-d844-4fcd-aa58-fb71688c3e81', 'Arav', 'Developer for Generate', '7', 'Speare Pl', 'Boston', 'MA', '02115');

INSERT INTO projects (id, developer_id, title, description, completed, funding_goal_cents, milestone, completion_date, premise, street, locality, state, zipcode, coordinates) VALUES ('c3733692-5a86-441f-8ad0-9c32c648bb72', '56ebee48-d844-4fcd-aa58-fb71688c3e81', 'Bowser Castle', 'A big fiery castle sitting on prime real estate', 'FALSE', '100000000', 'Land Control Secured', 'December 2027', '7', 'Speare Pl', 'Boston', 'MA', '02115', ST_GeogFromText('SRID=4326;POINT(42.34135 -71.09007)'));
INSERT INTO projects (id, developer_id, title, description, completed, funding_goal_cents, milestone, completion_date, premise, street, locality, state, zipcode, coordinates) VALUES ('d09c8f0f-13d3-4336-92e9-b0b2c8bce570', '56ebee48-d844-4fcd-aa58-fb71688c3e81', 'Spongebob Pineapple', 'A pineapple under the sea', 'TRUE', '18000000', 'Construction Completed', 'October 2025', '716', 'Columbus Ave', 'Boston', 'MA', '02120', ST_GeogFromText('SRID=4326;POINT(42.33772 -71.08530)'));
INSERT INTO projects (id, developer_id, title, description, completed, completion_date, funding_goal_cents, milestone, premise, street, locality, state, zipcode, coordinates) VALUES ('c3733692-5a86-441f-8ad0-9c32c648bb72', '56ebee48-d844-4fcd-aa58-fb71688c3e81', 'Bowser Castle', 'A big fiery castle sitting on prime real estate', 'FALSE', '12-3-2024', '100000000', 'Land Control Secured', '7', 'Speare Pl', 'Boston', 'MA', '02115', ST_GeogFromText('SRID=4326;POINT(42.34135 -71.09007)'));
INSERT INTO projects (id, developer_id, title, description, completed, completion_date, funding_goal_cents, milestone, premise, street, locality, state, zipcode, coordinates) VALUES ('d09c8f0f-13d3-4336-92e9-b0b2c8bce570', '56ebee48-d844-4fcd-aa58-fb71688c3e81', 'Spongebob Pineapple', 'A pineapple under the sea', 'TRUE', '12-3-2024', '18000000', 'Construction Complete', '716', 'Columbus Ave', 'Boston', 'MA', '02120', ST_GeogFromText('SRID=4326;POINT(42.33772 -71.08530)'));

INSERT INTO project_images (project_id, image_url) VALUES ('c3733692-5a86-441f-8ad0-9c32c648bb72', 'https://cdn2.thecatapi.com/images/MTk3OTMzMg.jpg');
INSERT INTO project_images (project_id, image_url) VALUES ('c3733692-5a86-441f-8ad0-9c32c648bb72', 'https://cdn2.thecatapi.com/images/MjA1MTYzNg.jpg');
Expand Down
18 changes: 9 additions & 9 deletions frontend/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"semi": true,
"tabWidth": 2,
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all",
"jsxSingleQuote": true,
"bracketSpacing": true
}
{
"semi": true,
"tabWidth": 2,
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all",
"jsxSingleQuote": true,
"bracketSpacing": true
}
71 changes: 35 additions & 36 deletions frontend/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ SplashScreen.preventAutoHideAsync();

// Navigates user to the log in screen if seesion is not found (i.e. user not logged in)
function RootNavigator() {
const { session, isLoading } = useAuth();
if (isLoading) {
return null; // or some loading screen (maybe we make in future?)
}
return session ? <TabNavigator /> : <TabNavigator />;
const { session, isLoading } = useAuth();
if (isLoading) {
return null; // or some loading screen (maybe we make in future?)
}
return session ? <TabNavigator /> : <LoginNavigator />;
}

function TestNavigator() {
Expand All @@ -30,38 +30,37 @@ function TestNavigator() {


export default function App() {
const [loaded, error] = useFonts({
'Nunito-Black': require('./assets/fonts/nunito/Nunito-Black.ttf'),
'Nunito-BoldItalic': require('./assets/fonts/nunito/Nunito-BoldItalic.ttf'),
'Nunito-Bold': require('./assets/fonts/nunito/Nunito-Bold.ttf'),
'Nunito-ExtraBold': require('./assets/fonts/nunito/Nunito-ExtraBold.ttf'),
'Nunito-Regular': require('./assets/fonts/nunito/Nunito-Regular.ttf'),
'Inter-Bold': require('./assets/fonts/inter/Inter_18pt-Bold.ttf'),
'Inter-Regular': require('./assets/fonts/inter/Inter_18pt-Regular.ttf'),
'SourceSans3-Bold': require('./assets/fonts/sourceSans3/SourceSans3-Bold.ttf'),
'SourceSans3-Medium': require('./assets/fonts/sourceSans3/SourceSans3-Medium.ttf'),
'SourceSans3-SemiBold': require('./assets/fonts/sourceSans3/SourceSans3-SemiBold.ttf'),
});
const [loaded, error] = useFonts({
'Nunito-Black': require('./assets/fonts/nunito/Nunito-Black.ttf'),
'Nunito-BoldItalic': require('./assets/fonts/nunito/Nunito-BoldItalic.ttf'),
'Nunito-Bold': require('./assets/fonts/nunito/Nunito-Bold.ttf'),
'Nunito-ExtraBold': require('./assets/fonts/nunito/Nunito-ExtraBold.ttf'),
'Nunito-Regular': require('./assets/fonts/nunito/Nunito-Regular.ttf'),
'Inter-Bold': require('./assets/fonts/inter/Inter_18pt-Bold.ttf'),
'Inter-Regular': require('./assets/fonts/inter/Inter_18pt-Regular.ttf'),
'SourceSans3-Bold': require('./assets/fonts/sourceSans3/SourceSans3-Bold.ttf'),
'SourceSans3-Medium': require('./assets/fonts/sourceSans3/SourceSans3-Medium.ttf'),
'SourceSans3-SemiBold': require('./assets/fonts/sourceSans3/SourceSans3-SemiBold.ttf'),
});

const queryClient = new QueryClient();
const queryClient = new QueryClient();

useEffect(() => {
if (loaded || error) {
SplashScreen.hideAsync();
}
}, [loaded, error]);

if (!loaded && !error) {
return null;
useEffect(() => {
if (loaded || error) {
SplashScreen.hideAsync();
}
return (

<AuthProvider>
<QueryClientProvider client={queryClient}>
<NavigationContainer>
<TestNavigator />
</NavigationContainer>
</QueryClientProvider>
</AuthProvider>
);
}, [loaded, error]);

if (!loaded && !error) {
return null;
}
return (
<AuthProvider>
<QueryClientProvider client={queryClient}>
<NavigationContainer>
<RootNavigator />
</NavigationContainer>
</QueryClientProvider>
</AuthProvider>
);
}
48 changes: 24 additions & 24 deletions frontend/__test__/homeScreen/homeScreen.test.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import React from 'react';
import renderer from 'react-test-renderer';
import { describe, expect, test } from '@jest/globals';
import { HomeScreen } from '../../src/screens/home/home';

describe('Home screen', () => {
test('Test that image is on home screen', () => {
// ARRANGE
// Using any since its irrelevant and this avoids type checks
// (this avoids needing to instantiate a real navigation object)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const mockNavigation: any = null;

// ACT
let root;
renderer.act(() => {
root = renderer.create(<HomeScreen navigation={mockNavigation} />);
});

// ASSERT
root.root.findByType('Image'); // This will throw an error if there is not exactly one image, so we know the image was rendered if the test succeeds
expect(root.root.findByType('Text').props.children).toBe('Dummy page');
});
});
import React from 'react';
import renderer from 'react-test-renderer';
import { describe, expect, test } from '@jest/globals';
import { HomeScreen } from '../../src/screens/home/home';

describe('Home screen', () => {
test('Test that image is on home screen', () => {
// ARRANGE
// Using any since its irrelevant and this avoids type checks
// (this avoids needing to instantiate a real navigation object)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const mockNavigation: any = null;

// ACT
let root;
renderer.act(() => {
root = renderer.create(<HomeScreen navigation={mockNavigation} />);
});

// ASSERT
root.root.findByType('Image'); // This will throw an error if there is not exactly one image, so we know the image was rendered if the test succeeds
expect(root.root.findByType('Text').props.children).toBe('Dummy page');
});
});
37 changes: 37 additions & 0 deletions frontend/app.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import 'dotenv/config';

export default {
expo: {
name: "3stones",
slug: "frontend",
version: "0.1.0",
orientation: "portrait",
icon: "./assets/images/icon.png",
userInterfaceStyle: "light",
splash: {
image: "./assets/images/splash.png",
resizeMode: "contain",
backgroundColor: "#ffffff"
},
ios: {
supportsTablet: true,
bundleIdentifier: "com.generate.3stones"
},
android: {
adaptiveIcon: {
foregroundImage: "./assets/images/adaptive-icon.png",
backgroundColor: "#ffffff"
}
},
web: {
favicon: "./assets/images/favicon.png"
},
extra: {
googleApiKey: process.env.GOOGLE_API_KEY,
eas: {
projectId: "27b7d706-8b3c-45f8-ba59-ae05df33c4de"
}
},
plugins: ["expo-font"]
}
};
68 changes: 34 additions & 34 deletions frontend/app.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"expo": {
"name": "3stones",
"slug": "frontend",
"version": "0.1.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.generate.3stones"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"web": {
"favicon": "./assets/images/favicon.png"
},
"extra": {
"eas": {
"projectId": "27b7d706-8b3c-45f8-ba59-ae05df33c4de"
}
},
"plugins": ["expo-font"]
}
}
{
"expo": {
"name": "3stones",
"slug": "frontend",
"version": "0.1.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.generate.3stones"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"web": {
"favicon": "./assets/images/favicon.png"
},
"extra": {
"eas": {
"projectId": "27b7d706-8b3c-45f8-ba59-ae05df33c4de"
}
},
"plugins": ["expo-font"]
}
}
Binary file added frontend/assets/images/celebration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/chevron-left-round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/chevron-right-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/close-outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/construction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/design_services.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/handyman.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/house.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/key-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/landscape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/left-arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/link-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/maps_home_work.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/money-success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/search-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/topic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 18 additions & 18 deletions frontend/eas.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"cli": {
"version": ">= 11.0.3"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal"
},
"production": {}
},
"submit": {
"production": {}
}
}
{
"cli": {
"version": ">= 11.0.3"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal"
},
"production": {}
},
"submit": {
"production": {}
}
}
Loading

0 comments on commit 364dcbc

Please sign in to comment.