Skip to content

Commit

Permalink
Merge pull request #16 from vietman2/feat/bug_fixes
Browse files Browse the repository at this point in the history
Feat/bug fixes
  • Loading branch information
vietman2 authored Nov 13, 2024
2 parents da23189 + 624d628 commit c00864e
Show file tree
Hide file tree
Showing 95 changed files with 2,796 additions and 316 deletions.
5 changes: 3 additions & 2 deletions sweep/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"userInterfaceStyle": "automatic",
"owner": "catchb",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.vietman2.sweep"
"bundleIdentifier": "com.sweepseries.catchb"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.vietman2.sweep"
"package": "com.sweepseries.catchb"
},
"web": {
"bundler": "metro",
Expand Down
7 changes: 3 additions & 4 deletions sweep/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
"version": "1.0.0",
"scripts": {
"start": "expo start --tunnel",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"test": "jest --watchAll",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
Expand Down Expand Up @@ -52,11 +50,11 @@
"expo-clipboard": "^6.0.3",
"expo-config-plugins": "^0.1.2",
"expo-constants": "^16.0.2",
"expo-dev-client": "^4.0.28",
"expo-dev-client": "^4.0.29",
"expo-font": "~12.0.9",
"expo-linear-gradient": "^13.0.2",
"expo-linking": "~6.3.1",
"expo-router": "~3.5.23",
"expo-router": "^3.5.23",
"expo-splash-screen": "~0.27.5",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.7",
Expand All @@ -68,6 +66,7 @@
"react-native-calendars": "^1.1307.0",
"react-native-collapsible-tab-view": "^8.0.0",
"react-native-gesture-handler": "~2.16.1",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-pager-view": "6.3.0",
"react-native-reanimated": "^3.16.1",
"react-native-safe-area-context": "4.10.5",
Expand Down
1 change: 0 additions & 1 deletion sweep/src/app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default function TabLayout() {
tabBarActiveTintColor: "#14863E",
headerShown: false,
}}
detachInactiveScreens={Platform.OS === "ios"}
>
<Tabs.Screen
name="home"
Expand Down
46 changes: 44 additions & 2 deletions sweep/src/app/(tabs)/calendar/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
import { Stack } from "expo-router";
import { TouchableOpacity } from "react-native";
import { Stack, router } from "expo-router";

import { AppIcon } from "@components/Icons";
import { useTheme } from "@contexts/theme";

export const unstable_settings = {
initialRouteName: "index",
};

export default function CalendarLayout() {
const { theme } = useTheme();

const handleBackPress = () => {
router.back();
};

const BackButton = () => {
return (
<TouchableOpacity onPress={handleBackPress}>
<AppIcon icon="chevron-left" size={20} color={theme.highEmphasis} />
</TouchableOpacity>
);
};

return (
<Stack
screenOptions={{
headerShown: false,
headerShadowVisible: false,
}}
>
<Stack.Screen name="index" />
Expand All @@ -25,7 +44,30 @@ export default function CalendarLayout() {
presentation: "modal",
headerShown: true,
headerTitle: "일정 추가",
headerShadowVisible: false,
}}
/>
<Stack.Screen
name="addtodo"
options={{
presentation: "modal",
headerShown: true,
headerTitle: "할 일 추가",
}}
/>
<Stack.Screen name="search" />
<Stack.Screen name="requests" />
<Stack.Screen
name="daily/[date]"
options={{
presentation: "modal",
}}
/>
<Stack.Screen
name="lesson/[id]"
options={{
headerShown: true,
headerLeft: () => <BackButton />,
headerTitle: "레슨 상세",
}}
/>
</Stack>
Expand Down
3 changes: 3 additions & 0 deletions sweep/src/app/(tabs)/calendar/addtodo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { AddTodo } from "@pages/calendar";

export default AddTodo;
3 changes: 3 additions & 0 deletions sweep/src/app/(tabs)/calendar/daily/[date].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { DailySchedule } from "@pages/calendar";

export default DailySchedule;
3 changes: 3 additions & 0 deletions sweep/src/app/(tabs)/calendar/lesson/[id].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { LessonDetail } from "@pages/calendar";

export default LessonDetail;
3 changes: 3 additions & 0 deletions sweep/src/app/(tabs)/calendar/requests.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { ReservationRequests } from "@pages/calendar";

export default ReservationRequests;
3 changes: 3 additions & 0 deletions sweep/src/app/(tabs)/calendar/search.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { CalendarSearch } from "@pages/calendar";

export default CalendarSearch;
13 changes: 11 additions & 2 deletions sweep/src/app/(tabs)/front/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { Stack } from "expo-router";

import { HorizontalLogo } from "@components/Icons";
import { CustomLogo } from "@components/Icons";
import { useTheme } from "@contexts/theme";

export default function FrontLayout() {
const { theme } = useTheme();

return (
<Stack screenOptions={{ headerShadowVisible: false }}>
<Stack.Screen
name="index"
options={{
headerLeft: () => <HorizontalLogo size={30} />,
headerLeft: () => (
<CustomLogo
image="https://picsum.photos/200"
color={theme.logo}
text="Catch B Academy"
/>
),
headerTitle: "",
}}
/>
Expand Down
8 changes: 7 additions & 1 deletion sweep/src/app/(tabs)/front/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { TabBar } from "@components/Tabs";
import {
CustomerManagement,
EmployeeManagement,
NoticeManagement,
ProfileManagement,
ProgramManagement,
ReviewManagement,
Expand All @@ -18,7 +19,7 @@ export default function Front() {
<Tab.Navigator
initialRouteName="profile"
initialLayout={{ width: screenWidth, height: screenHeight }}
tabBar={(props) => <TabBar {...props} />}
tabBar={(props) => <TabBar {...props} scrollable />}
screenOptions={{
tabBarScrollEnabled: true,
}}
Expand Down Expand Up @@ -50,6 +51,11 @@ export default function Front() {
component={EmployeeManagement}
options={{ title: "직원관리" }}
/>
<Tab.Screen
name="notices"
component={NoticeManagement}
options={{ title: "소식관리" }}
/>
</Tab.Navigator>
);
}
10 changes: 8 additions & 2 deletions sweep/src/components/Calendars/CustomDay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ export function CustomDay({ date, schedules }: Readonly<Props>) {
backgroundColor: schedule.color,
},
]}
key={schedule.text}
key={schedule.short_text}
>
<Text style={styles.chipText} numberOfLines={1} ellipsizeMode="clip">{schedule.text}</Text>
<Text
style={styles.chipText}
numberOfLines={1}
ellipsizeMode="clip"
>
{schedule.short_text}
</Text>
</View>
))}
</View>
Expand Down
2 changes: 1 addition & 1 deletion sweep/src/components/Filters/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function Filters({
onSelect,
}: Readonly<Props>) {
return (
<ScrollView horizontal>
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
{filters.map((filter) => (
<TouchableOpacity key={filter} onPress={() => onSelect(filter)}>
<Filter text={filter} isSelected={filter === selectedFilter} />
Expand Down
10 changes: 9 additions & 1 deletion sweep/src/components/Icons/Icons.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AppIcon } from "./AppIcon";
import { MainLogo, HorizontalLogo } from "./Logo";
import { CustomLogo, MainLogo, HorizontalLogo } from "./Logo";
import { renderWithProviders } from "@utils/test-utils";

jest.unmock("@components/Icons");
Expand All @@ -14,6 +14,14 @@ describe("<AppIcon />", () => {
});
});

describe("<CustomLogo />", () => {
it("renders correctly", () => {
renderWithProviders(
<CustomLogo image="image" text="text" color="black" />
);
});
});

describe("<MainLogo />", () => {
it("renders correctly", () => {
renderWithProviders(<MainLogo />);
Expand Down
30 changes: 29 additions & 1 deletion sweep/src/components/Icons/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StyleSheet, View } from "react-native";
import { Image, StyleSheet, Text, View } from "react-native";
import { SvgCssUri } from "react-native-svg/css";

import { useTheme } from "@contexts/theme";
Expand Down Expand Up @@ -38,6 +38,21 @@ export function HorizontalLogo({ size = 30 }: Readonly<Props>) {
);
}

interface CustomProps {
image: string;
text: string;
color: string;
}

export function CustomLogo({ image, text, color }: Readonly<CustomProps>) {
return (
<View style={styles.customContainer}>
<Image src={image} style={styles.image} />
<Text style={[styles.customText, { color }]}>{text}</Text>
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
Expand All @@ -46,4 +61,17 @@ const styles = StyleSheet.create({
width: "100%",
gap: 64,
},
customContainer: {
flexDirection: "row",
alignItems: "center",
gap: 8,
},
image: {
width: 30,
height: 30,
},
customText: {
fontSize: 22,
fontWeight: "bold",
},
});
4 changes: 2 additions & 2 deletions sweep/src/components/Icons/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SvgCssUri } from "react-native-svg/css";

import { AppIcon } from "./AppIcon";
import { HorizontalLogo, MainLogo } from "./Logo";
import { CustomLogo, HorizontalLogo, MainLogo } from "./Logo";

export { AppIcon, HorizontalLogo, MainLogo, SvgCssUri };
export { AppIcon, CustomLogo, HorizontalLogo, MainLogo, SvgCssUri };
8 changes: 4 additions & 4 deletions sweep/src/components/Inputs/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ const createStyles = (theme: ThemeColorType) =>
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
marginVertical: 5,
paddingVertical: 10,
marginVertical: 4,
paddingVertical: 12,
borderWidth: 1,
borderColor: theme.border,
borderRadius: 5,
borderRadius: 4,
},
textinputarea: {
flex: 1,
marginHorizontal: 10,
marginHorizontal: 8,
},
});
36 changes: 36 additions & 0 deletions sweep/src/components/Modals/Modals.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { render } from "@testing-library/react-native";

import { SimpleModal } from "./SimpleModal";

jest.unmock("@components/Modals");

describe("<SimpleModal />", () => {
it("renders correctly", () => {
render(
<SimpleModal
title="Title"
buttonText="Button"
visible={true}
hideModal={() => {}}
onButtonPress={() => {}}
>
<></>
</SimpleModal>
);
});

it("renders large modal correctly", () => {
render(
<SimpleModal
title="Title"
buttonText="Button"
visible={true}
hideModal={() => {}}
onButtonPress={() => {}}
large
>
<></>
</SimpleModal>
);
});
});
Loading

0 comments on commit c00864e

Please sign in to comment.