Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/components/GoogleButtom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// import { Text, TextProps } from "./Text";
// import { useAppTheme } from "@/utils/useAppTheme";


// import { useStores } from "@/models";
// import * as WebBrowser from "expo-web-browser";

Expand Down
2 changes: 0 additions & 2 deletions app/models/Firebase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ test("can be created", () => {

expect(instance).toBeTruthy()
})


2 changes: 0 additions & 2 deletions app/models/Firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ export interface Firebase extends Instance<typeof FirebaseModel> {}
export interface FirebaseSnapshotOut extends SnapshotOut<typeof FirebaseModel> {}
export interface FirebaseSnapshotIn extends SnapshotIn<typeof FirebaseModel> {}
export const createFirebaseDefaultModel = () => types.optional(FirebaseModel, {})


2 changes: 1 addition & 1 deletion app/navigators/AppNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const AppNavigator = observer(function AppNavigator(props: NavigationProp
const { themeScheme, navigationTheme, setThemeContextOverride, ThemeProvider } =
useThemeProvider()

const exitRoutes = ["welcome","Demo"] // Add any other routes that should exit the app here
const exitRoutes = ["welcome", "Demo"] // Add any other routes that should exit the app here
// This hook will handle the back button on Android and exit the app if the user is on an exit route
// You can customize the exit routes by modifying the `exitRoutes` array
useBackButtonHandler((routeName) => exitRoutes.includes(routeName))
Expand Down
83 changes: 56 additions & 27 deletions app/screens/DemoShowroomScreen/DemoShowroomScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { DemoTabParamList, DemoTabScreenProps } from "../../navigators/DemoNavig
import type { Theme, ThemedStyle } from "@/theme"
import { $styles } from "@/theme"
import { useSafeAreaInsetsStyle } from "../../utils/useSafeAreaInsetsStyle"
import { useIsMounted } from "../../utils/useIsMounted"
import * as Demos from "./demos"
import { DrawerIconButton } from "./DrawerIconButton"
import SectionListWithKeyboardAwareScrollView from "./SectionListWithKeyboardAwareScrollView"
Expand Down Expand Up @@ -99,6 +100,7 @@ export const DemoShowroomScreen: FC<DemoTabScreenProps<"DemoShowroom">> =
const menuRef = useRef<ListViewRef<DemoListItem["item"]>>(null)
const route = useRoute<RouteProp<DemoTabParamList, "DemoShowroom">>()
const params = route.params
const isMounted = useIsMounted()

const { themed, theme } = useAppTheme()

Expand All @@ -110,39 +112,66 @@ export const DemoShowroomScreen: FC<DemoTabScreenProps<"DemoShowroom">> =
}
}, [open])

const handleScroll = useCallback((sectionIndex: number, itemIndex = 0) => {
try {
listRef.current?.scrollToLocation({
animated: true,
itemIndex,
sectionIndex,
viewPosition: 0.25,
})
} catch (e) {
console.error(e)
}
}, [])
const handleScroll = useCallback(
(sectionIndex: number, itemIndex = 0) => {
if (!isMounted()) return

try {
listRef.current?.scrollToLocation({
animated: true,
itemIndex,
sectionIndex,
viewPosition: 0.25,
})
} catch (e) {
// Silently handle scroll errors to prevent console spam
// Only log in development mode
if (__DEV__) {
console.warn("Scroll error:", e)
}
}
},
[isMounted],
)

// handle Web links
useEffect(() => {
if (params !== undefined && Object.keys(params).length > 0) {
const demoValues = Object.values(Demos)
const findSectionIndex = demoValues.findIndex(
(x) => x.name.toLowerCase() === params.queryIndex,
)
let findItemIndex = 0
if (params.itemIndex) {
try {
findItemIndex = demoValues[findSectionIndex]
.data({ themed, theme })
.findIndex((u) => slugify(translate(u.props.name)) === params.itemIndex)
} catch (err) {
console.error(err)
if (!isMounted() || !params || Object.keys(params).length === 0) {
return
}

const demoValues = Object.values(Demos)
const findSectionIndex = demoValues.findIndex(
(x) => x.name.toLowerCase() === params.queryIndex,
)

if (findSectionIndex === -1) {
return
}

let findItemIndex = 0
if (params.itemIndex) {
try {
const demoData = demoValues[findSectionIndex]?.data({ themed, theme })
if (demoData) {
findItemIndex = demoData.findIndex(
(u) => slugify(translate(u.props.name)) === params.itemIndex,
)
if (findItemIndex === -1) {
findItemIndex = 0
}
}
} catch (err) {
// Silently handle translation errors to prevent console spam
// Only log in development mode
if (__DEV__) {
console.warn("Translation error for item index:", err)
}
findItemIndex = 0
}
handleScroll(findSectionIndex, findItemIndex)
}
}, [handleScroll, params, theme, themed])
handleScroll(findSectionIndex, findItemIndex)
}, [handleScroll, params, theme, themed, isMounted])

const scrollToIndexFailed = (info: {
index: number
Expand Down
14 changes: 7 additions & 7 deletions app/services/Firebase/firebase.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
import { getAuth } from "firebase/auth";
import { initializeApp } from "firebase/app"
import { getAnalytics } from "firebase/analytics"
import { getAuth } from "firebase/auth"
// import { getFirestore } from "firebase/firestore";
// import { getStorage } from "firebase/storage";
// import { getFunctions } from "firebase/functions";
Expand All @@ -18,9 +18,9 @@ const firebaseConfig = {
storageBucket: "dooit-5c76d.firebasestorage.app",
messagingSenderId: "477979903432",
appId: "1:477979903432:web:3c6d87a5dc4424887cecfd",
measurementId: "G-12ZZX5PBG0"
};
measurementId: "G-12ZZX5PBG0",
}

// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
const app = initializeApp(firebaseConfig)
const analytics = getAnalytics(app)
15 changes: 0 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2944,11 +2944,6 @@
resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz"
integrity sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==

"@unrs/resolver-binding-darwin-arm64@1.7.8":
version "1.7.8"
resolved "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.7.8.tgz"
integrity sha512-rsRK8T7yxraNRDmpFLZCWqpea6OlXPNRRCjWMx24O1V86KFol7u2gj9zJCv6zB1oJjtnzWceuqdnCgOipFcJPA==

"@urql/core@^5.0.6", "@urql/core@^5.1.1":
version "5.1.1"
resolved "https://registry.npmjs.org/@urql/core/-/core-5.1.1.tgz"
Expand Down Expand Up @@ -5617,11 +5612,6 @@ fs.realpath@^1.0.0:
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==

fsevents@^2.3.2:
version "2.3.3"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==

function-bind@^1.1.2:
version "1.1.2"
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz"
Expand Down Expand Up @@ -7124,11 +7114,6 @@ lighthouse-logger@^1.0.0:
debug "^2.6.9"
marky "^1.2.2"

lightningcss-darwin-arm64@1.27.0:
version "1.27.0"
resolved "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.27.0.tgz"
integrity sha512-Gl/lqIXY+d+ySmMbgDf0pgaWSqrWYxVHoc88q+Vhf2YNzZ8DwoRzGt5NZDVqqIW5ScpSnmmjcgXP87Dn2ylSSQ==

lightningcss@~1.27.0:
version "1.27.0"
resolved "https://registry.npmjs.org/lightningcss/-/lightningcss-1.27.0.tgz"
Expand Down