Skip to content

Commit

Permalink
Clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
Alder Whiteford authored and Alder Whiteford committed May 29, 2024
1 parent cc3ac45 commit 02f8175
Show file tree
Hide file tree
Showing 10 changed files with 271 additions and 112 deletions.
30 changes: 12 additions & 18 deletions frontend/mobile/app/(app)/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,38 +54,32 @@ const Layout = () => {
options={{
title: 'Home',
headerShown: false,
tabBarLabel: ({ focused }) => (
<TabBarLabel focused={focused} title="Home" />
),
tabBarIcon: ({ focused }) => (
<TabBarIcon focused={focused} icon={faHouse} />
)
tabBarLabel: ({ focused }) =>
TabBarLabel({ focused, title: 'Home' }),
tabBarIcon: ({ focused }) =>
TabBarIcon({ focused, icon: faHouse })
}}
/>
<Tabs.Screen
name="calendar"
options={{
title: 'Calendar',
headerShown: false,
tabBarLabel: ({ focused }) => (
<TabBarLabel focused={focused} title="Calendar" />
),
tabBarIcon: ({ focused }) => (
<TabBarIcon focused={focused} icon={faCalendarDays} />
)
tabBarLabel: ({ focused }) =>
TabBarLabel({ focused, title: 'Calendar' }),
tabBarIcon: ({ focused }) =>
TabBarIcon({ focused, icon: faCalendarDays })
}}
/>
<Tabs.Screen
name="profile"
options={{
title: 'Profile',
headerShown: false,
tabBarLabel: ({ focused }) => (
<TabBarLabel focused={focused} title="Profile" />
),
tabBarIcon: ({ focused }) => (
<TabBarIcon focused={focused} icon={faUser} />
)
tabBarLabel: ({ focused }) =>
TabBarLabel({ focused, title: 'Profile' }),
tabBarIcon: ({ focused }) =>
TabBarIcon({ focused, icon: faUser })
}}
/>
</Tabs>
Expand Down
2 changes: 1 addition & 1 deletion frontend/mobile/app/(app)/(tabs)/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StyleSheet, View } from 'react-native';

import { Text } from '@/app/(design-system)';
import { RecruitmentInfo } from '@/components/club-recruitment-info';
import { RecruitmentInfo } from '@/app/(design-system)/components/ClubRecruitment/RecruitmentInfo/ClubRecruitmentInfo';

const HomePage = () => {
return (
Expand Down
5 changes: 0 additions & 5 deletions frontend/mobile/app/(auth)/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import React from 'react';
import { Text, View } from 'react-native';

import { Button } from '../(design-system)/components/Button/Button';

const Welcome = () => {
return (
<View>
<Text>Welcome</Text>
<Button variant="standardButton" color="blue">
Hello
</Button>
</View>
);
};
Expand Down
16 changes: 0 additions & 16 deletions frontend/mobile/app/(design-system)/Colors.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { faComments } from '@fortawesome/free-solid-svg-icons/faComments';
import { faPenToSquare } from '@fortawesome/free-solid-svg-icons/faPenToSquare';
import { RecruitmentCycle, RecruitmentType } from '@generatesac/lib';

import { Box, ColorName } from '@/app/(design-system)';
import { Box, SACColors, createStyles } from '@/app/(design-system)';

import { RecruitmentItem } from './club-recruitment-item';
import { RecruitmentItem } from '../RecruitmentItem/ClubRecruitmentItem';

interface RecruitmentInfoProps {
color: ColorName;
color: SACColors;
recruitmentCycle: RecruitmentCycle;
recruitingType: RecruitmentType;
isRecruiting?: boolean;
Expand All @@ -25,13 +25,7 @@ export const RecruitmentInfo = ({
isRecruiting = false
}: RecruitmentInfoProps) => {
return (
<Box
padding="l"
flexDirection="row"
gap="m"
alignItems="stretch"
justifyContent="space-evenly"
>
<Box {...styles.recruitmentInfo}>
<RecruitmentItem
icon={faCalendar}
title="Recruitment Cycle"
Expand All @@ -57,3 +51,13 @@ export const RecruitmentInfo = ({
</Box>
);
};

const styles = createStyles({
recruitmentInfo: {
padding: 'l',
flexDirection: 'row',
gap: 'm',
alignItems: 'stretch',
justifyContent: 'space-evenly'
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';

import { Box, SACColors, Text, createStyles } from '@/app/(design-system)';
import { firstLetterUppercase } from '@/utils/string';

import { Icon } from '../../Icon/Icon';

interface RecruitmentItemProps {
icon: IconDefinition;
title: string;
text: string;
color: SACColors;
}

export const RecruitmentItem = ({
icon,
title,
text,
color
}: RecruitmentItemProps) => {
return (
<Box {...styles.recruitmentItem}>
<Box {...styles.recruitmentItemContent}>
<Icon size={'medium'} color={color} icon={icon} />
<Text variant="body-1" {...styles.recruitmentItemTitle}>
{firstLetterUppercase(title)}
</Text>
<Text variant="caption-1" style={{ textAlign: 'center' }}>
{firstLetterUppercase(text)}
</Text>
</Box>
</Box>
);
};

const styles = createStyles({
recruitmentItem: {
alignItems: 'center',
borderWidth: 1,
borderRadius: 'base',
borderColor: 'gray',
width: '33%'
},
recruitmentItemContent: {
paddingTop: 'm',
paddingBottom: 'm',
gap: 'xs',
flexDirection: 'column',
alignItems: 'center'
},
recruitmentItemTitle: {
textAlign: 'center',
fontWeight: '600'
}
});
10 changes: 7 additions & 3 deletions frontend/mobile/app/(design-system)/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome';

import { SACColors } from '../../shared/colors';
import { Colors, SACColors, defaultColor } from '../../shared/colors';
import { ComponentSizes } from '../../shared/types';
import { createStyles } from '../../theme';

Expand All @@ -11,12 +11,16 @@ type IconProps = {
color?: SACColors;
};

export const Icon: React.FC<IconProps> = ({ icon, size = 'medium', color }) => {
export const Icon: React.FC<IconProps> = ({
icon,
size = 'medium',
color = defaultColor
}) => {
return (
<FontAwesomeIcon
icon={icon}
size={styles[size].fontSize}
color={color}
color={Colors[color]}
/>
);
};
Expand Down
51 changes: 0 additions & 51 deletions frontend/mobile/components/club-recruitment-item.tsx

This file was deleted.

2 changes: 2 additions & 0 deletions frontend/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
"react-native-reanimated": "^3.11.0",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "3.31.1",
"react-native-svg": "^15.3.0",
"react-native-svg-transformer": "^1.4.0",
"react-native-web": "~0.19.10",
"react-redux": "^9.1.2"
},
Expand Down
Loading

0 comments on commit 02f8175

Please sign in to comment.