Skip to content

Commit 84ecb0e

Browse files
authored
chore(companion): update dependencies to latest expo canary version (calcom#25948)
* chore: update dependencies and update event types screen header * refactor: simplify EventTypeListItem component by removing unused imports and code - Removed unnecessary imports such as Tooltip and Svg. - Cleaned up the component by eliminating commented-out code and unused props. - Streamlined the button rendering in the context menu for better readability. * feat: enhance EventTypes header with blur effect and clean up code - Added blurEffect property to Stack.Header for improved visual aesthetics. - Removed commented-out code to streamline the EventTypes component. - Updated search bar properties for better user experience. * refactor: update TabLayout and EventTypes for improved platform handling - Simplified TabLayout by removing the liquid glass effect check and adding a WebTabs fallback for web support. - Updated EventTypes header to conditionally apply blur effect based on liquid glass availability, enhancing visual consistency across platforms. * feat: enhance TabLayout with MaterialCommunityIcons for improved UI - Updated TabLayout to use MaterialCommunityIcons for tab icons, enhancing visual consistency. - Added softwareKeyboardLayoutMode to app.json for better keyboard handling on mobile devices. * feat: update TabLayout to prevent transparent background on iOS 18 - Added disableTransparentOnScrollEdge prop to NativeTabs to ensure a solid background on iOS 18 and older versions.
1 parent 27775e5 commit 84ecb0e

6 files changed

Lines changed: 184 additions & 198 deletions

File tree

companion/app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"backgroundColor": "#ffffff"
2828
},
2929
"edgeToEdgeEnabled": true,
30-
"package": "com.calcom.companion"
30+
"package": "com.calcom.companion",
31+
"softwareKeyboardLayoutMode": "pan"
3132
},
3233
"web": {
3334
"favicon": "./assets/favicon.png",

companion/app/(tabs)/(event-types)/index.tsx

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
} from "../../../hooks";
3636
import { getEventDuration } from "../../../utils/getEventDuration";
3737
import { normalizeMarkdown } from "../../../utils/normalizeMarkdown";
38+
import { isLiquidGlassAvailable } from "expo-glass-effect";
3839

3940
export default function EventTypes() {
4041
const router = useRouter();
@@ -469,41 +470,23 @@ export default function EventTypes() {
469470

470471
return (
471472
<>
472-
<Stack.Screen
473-
options={{
474-
headerShown: Platform.OS !== "web",
475-
title: "Event Types",
476-
headerLargeTitleEnabled: true,
477-
headerStyle: {
478-
backgroundColor: "transparent",
479-
},
480-
headerSearchBarOptions: {
481-
placeholder: "Search event types",
482-
barTintColor: "#fff",
483-
obscureBackground: false,
484-
onChangeText: (e) => {
485-
handleSearch(e.nativeEvent.text);
486-
},
487-
},
488-
unstable_headerRightItems: () => [
489-
{
490-
type: "button",
491-
label: "New",
492-
labelStyle: {
493-
// style if needed
494-
},
495-
variant: "prominent",
496-
tintColor: "#000",
497-
// icon: {
498-
// name: "plus",
499-
// type: "sfSymbol",
500-
// },
501-
onPress: handleCreateNew,
502-
},
503-
],
504-
}}
505-
/>
506-
473+
<Stack.Header
474+
style={{ backgroundColor: "transparent", shadowColor: "transparent" }}
475+
blurEffect={isLiquidGlassAvailable() ? undefined : "light"} // Only looks cool on iOS 18 and below
476+
>
477+
<Stack.Header.Title large>Event Types</Stack.Header.Title>
478+
<Stack.Header.Right>
479+
<Stack.Header.Button onPress={handleCreateNew} tintColor="#000" variant="prominent">
480+
New
481+
</Stack.Header.Button>
482+
</Stack.Header.Right>
483+
<Stack.Header.SearchBar
484+
placeholder="Search event types"
485+
onChangeText={(e) => handleSearch(e.nativeEvent.text)}
486+
obscureBackground={false}
487+
barTintColor="#fff"
488+
/>
489+
</Stack.Header>
507490
<Activity mode={Platform.OS === "web" ? "visible" : "hidden"}>
508491
<Header />
509492
<View className="flex-row items-center gap-3 border-b border-gray-300 bg-gray-100 px-4 py-2">

companion/app/(tabs)/_layout.tsx

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,54 @@
1-
import { Ionicons } from "@expo/vector-icons";
2-
import { isLiquidGlassAvailable } from "expo-glass-effect";
3-
import { Tabs } from "expo-router";
1+
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
2+
import { Tabs, VectorIcon } from "expo-router";
43
import { NativeTabs } from "expo-router/unstable-native-tabs";
54
import { Platform } from "react-native";
65

76
export default function TabLayout() {
8-
// Check if liquid glass effect is available
9-
const supportsLiquidGlass = isLiquidGlassAvailable();
7+
if (Platform.OS === "web") {
8+
return <WebTabs />;
9+
}
1010

11-
// Use NativeTabs for iOS 15+ (liquid glass support), fallback to standard Tabs
12-
if (supportsLiquidGlass) {
13-
return (
14-
<NativeTabs>
15-
<NativeTabs.Trigger name="(event-types)">
16-
<NativeTabs.Trigger.Icon sf="link" />
17-
<NativeTabs.Trigger.Label>Event Types</NativeTabs.Trigger.Label>
18-
</NativeTabs.Trigger>
11+
return (
12+
<NativeTabs
13+
disableTransparentOnScrollEdge={true} // Used to prevent transparent background on iOS 18 and older
14+
>
15+
<NativeTabs.Trigger name="(event-types)">
16+
<NativeTabs.Trigger.Icon
17+
sf="link"
18+
src={<VectorIcon family={MaterialCommunityIcons} name="link" />}
19+
/>
20+
<NativeTabs.Trigger.Label>Event Types</NativeTabs.Trigger.Label>
21+
</NativeTabs.Trigger>
1922

20-
<NativeTabs.Trigger name="bookings">
21-
<NativeTabs.Trigger.Icon sf="calendar" />
22-
<NativeTabs.Trigger.Label>Bookings</NativeTabs.Trigger.Label>
23-
</NativeTabs.Trigger>
23+
<NativeTabs.Trigger name="bookings">
24+
<NativeTabs.Trigger.Icon
25+
sf="calendar"
26+
src={<VectorIcon family={MaterialCommunityIcons} name="calendar" />}
27+
/>
28+
<NativeTabs.Trigger.Label>Bookings</NativeTabs.Trigger.Label>
29+
</NativeTabs.Trigger>
2430

25-
<NativeTabs.Trigger name="availability">
26-
<NativeTabs.Trigger.Icon sf="clock" />
27-
<NativeTabs.Trigger.Label>Availability</NativeTabs.Trigger.Label>
28-
</NativeTabs.Trigger>
31+
<NativeTabs.Trigger name="availability">
32+
<NativeTabs.Trigger.Icon
33+
sf="clock"
34+
src={<VectorIcon family={MaterialCommunityIcons} name="clock" />}
35+
/>
36+
<NativeTabs.Trigger.Label>Availability</NativeTabs.Trigger.Label>
37+
</NativeTabs.Trigger>
2938

30-
<NativeTabs.Trigger name="more">
31-
<NativeTabs.Trigger.Icon sf="ellipsis" />
32-
<NativeTabs.Trigger.Label>More</NativeTabs.Trigger.Label>
33-
</NativeTabs.Trigger>
34-
</NativeTabs>
35-
);
36-
}
39+
<NativeTabs.Trigger name="more">
40+
<NativeTabs.Trigger.Icon
41+
sf="ellipsis"
42+
src={<VectorIcon family={MaterialCommunityIcons} name="dots-horizontal" />}
43+
/>
44+
<NativeTabs.Trigger.Label>More</NativeTabs.Trigger.Label>
45+
</NativeTabs.Trigger>
46+
</NativeTabs>
47+
);
48+
}
3749

38-
// Fallback to standard Expo Router Tabs for older iOS and Android
50+
// TODO: Remove this once native tabs are supported on web
51+
function WebTabs() {
3952
return (
4053
<Tabs
4154
screenOptions={{

0 commit comments

Comments
 (0)