Skip to content

Commit

Permalink
cd
Browse files Browse the repository at this point in the history
  • Loading branch information
Alder Whiteford authored and Alder Whiteford committed Jun 15, 2024
1 parent e129072 commit 0727a20
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 93 deletions.
2 changes: 1 addition & 1 deletion frontend/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@generatesac/lib",
"version": "0.0.169",
"version": "0.0.170",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 0 additions & 2 deletions frontend/lib/src/types/category.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { z } from "zod";

import { rootModelSchema } from "./root";
import { tagSchema } from "./tag";

// Schemas:
export const createCategoryRequestBodySchema = z.object({
Expand All @@ -10,7 +9,6 @@ export const createCategoryRequestBodySchema = z.object({

export const categorySchemaIntermediate = z.object({
name: z.string(),
tags: z.array(tagSchema),
});

export const categorySchema = categorySchemaIntermediate.merge(rootModelSchema);
Expand Down
2 changes: 1 addition & 1 deletion frontend/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.2",
"@fortawesome/react-native-fontawesome": "^0.3.2",
"@generatesac/lib": "0.0.169",
"@generatesac/lib": "0.0.170",
"@gorhom/bottom-sheet": "^4.6.3",
"@hookform/resolvers": "^3.4.2",
"@react-native-async-storage/async-storage": "^1.23.1",
Expand Down
7 changes: 3 additions & 4 deletions frontend/mobile/src/app/(app)/(tabs)/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ProfileItem = ({ icon, text, textColor, onPress }: ProfileItemProps) => (
<TouchableOpacity onPress={onPress}>
<Box
gap="l"
paddingVertical="m"
paddingVertical="s"
flexDirection="row"
alignItems="center"
>
Expand Down Expand Up @@ -98,9 +98,8 @@ const styles = StyleSheet.create({
flexDirection: 'column',
alignItems: 'flex-start',
justifyContent: 'flex-start',
marginHorizontal: Spacing.xl,
gap: Spacing.xxl,
marginTop: Spacing.xxl
marginVertical: Spacing.m,
gap: Spacing.l,

Check failure on line 102 in frontend/mobile/src/app/(app)/(tabs)/profile.tsx

View workflow job for this annotation

GitHub Actions / Lint

Delete `,`
},
title: {
fontSize: 20,
Expand Down
10 changes: 4 additions & 6 deletions frontend/mobile/src/app/(app)/event/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,8 @@ const EventPage = () => {
eventName={event.name}
color={MockEvent.color}
club={club?.name}
startTime={
new Date(event.start_time)
}
endTime={new Date(event.end_time)}
startTime={event.start_time}
endTime={event.end_time}
location={
event.location ||
'ISEC, Room 204'
Expand Down Expand Up @@ -224,8 +222,8 @@ const EventPage = () => {
</Animated.ScrollView>
<ShareEventBottomSheet ref={shareEvent} link={MockEvent.link} />
<RegisterBottomSheet
startTime={new Date(event?.start_time as string)}
endTime={new Date(event?.end_time as string)}
startTime={event?.start_time as string}
endTime={event?.end_time as string}
eventDetail={event?.description as string}
eventName={event?.name as string}
location={event?.location as string}
Expand Down
24 changes: 7 additions & 17 deletions frontend/mobile/src/app/(app)/user/interest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import { SafeAreaView } from 'react-native-safe-area-context';

import { Stack, router } from 'expo-router';

import { Category, Tag } from '@generatesac/lib';
import { Category, Tag, categoryApi, tagApi } from '@generatesac/lib';
import { ZodError } from 'zod';

import { Arrow, Box, Spacing, Text } from '@/src/app/(design-system)';
import { Tag as TagComponent } from '@/src/app/(design-system)';
import { useCategories } from '@/src/hooks/use-categories';
import { useTags } from '@/src/hooks/use-tags';
import { formatCategoryOrTag } from '@/src/utils/string';

import { Save } from './components/save';
Expand Down Expand Up @@ -56,16 +54,8 @@ const UserInterest = () => {
const { handleSubmit } = useForm<UserInterestsData>();

const [_, setButtonClicked] = useState<boolean>(false);
const {
data: categoryData,
isLoading: loadingCategories,
error: errorCategory
} = useCategories();
const {
data: tagsData,
isLoading: loadingTags,
error: errorTag
} = useTags();
const { data: tagData, error: tagError, isLoading: tagLoading} = tagApi.useTagsQuery({});

Check failure on line 57 in frontend/mobile/src/app/(app)/user/interest.tsx

View workflow job for this annotation

GitHub Actions / Lint

Replace `·data:·tagData,·error:·tagError,·isLoading:·tagLoading` with `⏎········data:·tagData,⏎········error:·tagError,⏎········isLoading:·tagLoading⏎····`
const { data: categoryData, error: categoryError, isLoading: categoryLoading} = categoryApi.useCategoriesQuery({});

Check failure on line 58 in frontend/mobile/src/app/(app)/user/interest.tsx

View workflow job for this annotation

GitHub Actions / Lint

Replace `·data:·categoryData,·error:·categoryError,·isLoading:·categoryLoading` with `⏎········data:·categoryData,⏎········error:·categoryError,⏎········isLoading:·categoryLoading⏎····`

const [selectedCategory, setSelectedCategory] = useState<Category>();
const [selectedTags, setSelectedTags] = useState<Tag[]>(mockTags);
Expand All @@ -78,16 +68,16 @@ const UserInterest = () => {
}
}, [categoryData]);

if (loadingTags || loadingCategories) {
if (tagLoading || categoryLoading) {
return <Text>Loading...</Text>;
}

if (errorTag || errorCategory) {
if (tagError || categoryError) {
return <Text>Error</Text>;
}

const tags = tagsData ? tagsData : [];
const categories = categoryData ? categoryData : [];
const tags = tagData ?? [];
const categories = categoryData ?? [];

const isSelected = (item: Tag) => {
return selectedTags.map((tag) => tag.id).includes(item.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export default function DayTimeSection({ time, data }: DayTimeSectionProps) {
club={event.host_name}
logo={event.host_logo}
eventId={event.id}
startTime={new Date(event.startTime)}
endTime={new Date(event.endTime)}
startTime={event.startTime}
endTime={event.endTime}
image={event.image}
/>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ViewBase = createBox(View);

export const GlobalLayout = ({ children }: GlobalLayoutProps) => {
return (
<ViewBase flex={1} marginHorizontal={'s'}>
<ViewBase flex={1} marginHorizontal={'l'}>
{children}
</ViewBase>
);
Expand Down
5 changes: 0 additions & 5 deletions frontend/mobile/src/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { StatusBar } from 'expo-status-bar';

import FontAwesome from '@expo/vector-icons/FontAwesome';
import { ThemeProvider } from '@shopify/restyle';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

import StoreProvider from '../store/StoreProvider';
import { useAppSelector } from '../store/store';
Expand Down Expand Up @@ -57,17 +56,13 @@ const RootLayout = () => {

if (!loaded) return null;

const queryClient = new QueryClient();

return (
<GestureHandlerRootView style={{ flex: 1 }}>
<StoreProvider>
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={theme}>

Check failure on line 62 in frontend/mobile/src/app/_layout.tsx

View workflow job for this annotation

GitHub Actions / Lint

Delete `····`
<StatusBar style="light" />

Check failure on line 63 in frontend/mobile/src/app/_layout.tsx

View workflow job for this annotation

GitHub Actions / Lint

Delete `····`
<InitalLayout />

Check failure on line 64 in frontend/mobile/src/app/_layout.tsx

View workflow job for this annotation

GitHub Actions / Lint

Delete `····`
</ThemeProvider>

Check failure on line 65 in frontend/mobile/src/app/_layout.tsx

View workflow job for this annotation

GitHub Actions / Lint

Delete `····`
</QueryClientProvider>
</StoreProvider>
</GestureHandlerRootView>
);
Expand Down
11 changes: 0 additions & 11 deletions frontend/mobile/src/hooks/use-categories.ts

This file was deleted.

11 changes: 0 additions & 11 deletions frontend/mobile/src/hooks/use-tags.ts

This file was deleted.

14 changes: 0 additions & 14 deletions frontend/mobile/src/services/categories.ts

This file was deleted.

14 changes: 0 additions & 14 deletions frontend/mobile/src/services/tags.ts

This file was deleted.

8 changes: 4 additions & 4 deletions frontend/mobile/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1402,10 +1402,10 @@
humps "^2.0.1"
prop-types "^15.7.2"

"@generatesac/lib@0.0.169":
version "0.0.169"
resolved "https://registry.yarnpkg.com/@generatesac/lib/-/lib-0.0.169.tgz#6a5799bad43b7c08553a04e5e6ed401ed0b7e7ab"
integrity sha512-IeWdlMKTi9zdqeaSMWWB+fjma6zf3Z1lO7mPmQ8Q+PJ49CkjJVbF5G9tdYgnJrNSz9+fazr5kFXZZl26eJaN0w==
"@generatesac/lib@0.0.170":
version "0.0.170"
resolved "https://registry.yarnpkg.com/@generatesac/lib/-/lib-0.0.170.tgz#2401ac4216d43dc555f142633aba16d1141ca356"
integrity sha512-oPkqZTudQd7tGEQUpAXQrhD/cngIUV595q069d7SMQZ3zZleQqGXirvk1TOjdoEzNug1gN21yS238stq6CL4Nw==
dependencies:
"@reduxjs/toolkit" "^2.2.3"
react "^18.2.0"
Expand Down

0 comments on commit 0727a20

Please sign in to comment.