From d762a8f70fe6c77a546a0a332ba929c08c34c198 Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 19 Aug 2024 07:58:36 -0700 Subject: [PATCH] clean up raw svg. give up on dark theme switcher. ready for another release. --- app/_layout.tsx | 44 ++++++++++++------- .../carpet-roll-length-inner-diameter-raw.svg | 4 +- ...carpet-roll-length-number-of-rings-raw.svg | 4 +- .../carpet-roll-length-outer-diameter-raw.svg | 4 +- .../images/icons/carpet-roll-length-raw.svg | 43 +++--------------- assets/images/icons/icon-carpet-roll-raw.svg | 4 +- components/ProductCalculatorSelector.tsx | 24 ++++++---- 7 files changed, 52 insertions(+), 75 deletions(-) diff --git a/app/_layout.tsx b/app/_layout.tsx index ede3e13..87d7d0f 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -1,12 +1,19 @@ -import 'react-native-reanimated'; -import 'react-native-gesture-handler'; -import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native'; -import { useFonts } from 'expo-font'; -import { Stack } from 'expo-router'; -import * as SplashScreen from 'expo-splash-screen'; -import { useEffect } from 'react'; +import "react-native-reanimated"; +import "react-native-gesture-handler"; +import { + DarkTheme, + DefaultTheme, + ThemeProvider, +} from "@react-navigation/native"; +import { useFonts } from "expo-font"; +import { Stack } from "expo-router"; +import * as SplashScreen from "expo-splash-screen"; +import { useEffect, useState } from "react"; -import { useColorScheme } from '@/hooks/useColorScheme'; +import { useColorScheme } from "@/hooks/useColorScheme"; +import { Appearance, StyleSheet, Text, Pressable } from "react-native"; + +const isBrowser = typeof window !== "undefined"; // Prevent the splash screen from auto-hiding before asset loading is complete. SplashScreen.preventAutoHideAsync(); @@ -14,9 +21,18 @@ SplashScreen.preventAutoHideAsync(); export default function RootLayout() { const colorScheme = useColorScheme(); const [loaded] = useFonts({ - SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'), + SpaceMono: require("../assets/fonts/SpaceMono-Regular.ttf"), }); + function changeTheme() { + console.debug("Changing color scheme"); + if (Appearance.getColorScheme() === "dark") { + Appearance.setColorScheme("light"); + } else { + Appearance.setColorScheme("dark"); + } + } + useEffect(() => { if (loaded) { SplashScreen.hideAsync(); @@ -27,18 +43,12 @@ export default function RootLayout() { return null; } - // return ( - // - // Hello World! - // - // ) - return ( - + ); -} +} \ No newline at end of file diff --git a/assets/images/icons/carpet-roll-length-inner-diameter-raw.svg b/assets/images/icons/carpet-roll-length-inner-diameter-raw.svg index adaf16c..067260a 100644 --- a/assets/images/icons/carpet-roll-length-inner-diameter-raw.svg +++ b/assets/images/icons/carpet-roll-length-inner-diameter-raw.svg @@ -6,9 +6,7 @@ height="200mm" viewBox="0 0 200 200" version="1.1" - id="svg5" - xmlns="http://www.w3.org/2000/svg" - xmlns:svg="http://www.w3.org/2000/svg"> + id="svg5"> + id="svg5"> + id="svg5"> - + id="svg5"> + d="m 61.405087,24.188362 95.383293,-52.476396 c 24.96471,-6.689275 40.50388,-5.439089 53.53212,6.973747 13.06695,12.4497209 16.56131,25.0292929 9.58226,53.29021 l -79.61121,74.744307"> + id="path2296" /> + id="path2365" /> + id="path2419" /> diff --git a/assets/images/icons/icon-carpet-roll-raw.svg b/assets/images/icons/icon-carpet-roll-raw.svg index e28e57e..77031b0 100644 --- a/assets/images/icons/icon-carpet-roll-raw.svg +++ b/assets/images/icons/icon-carpet-roll-raw.svg @@ -6,9 +6,7 @@ height="154.33244mm" viewBox="0 0 138.30681 154.33244" version="1.1" - id="svg5" - xmlns="http://www.w3.org/2000/svg" - xmlns:svg="http://www.w3.org/2000/svg"> + id="svg5"> {activeProduct ? ( "w" in activeProduct.dimensions ? ( - + + + + ) : ( ) ) : (