refactor: clean up unused imports and components across the project
This commit is contained in:
parent
9c0afe87db
commit
0972670cf4
18 changed files with 250 additions and 4097 deletions
4
app.json
4
app.json
|
@ -22,12 +22,12 @@
|
|||
}
|
||||
},
|
||||
"web": {
|
||||
"bundler": "metro",
|
||||
|
||||
"output": "static",
|
||||
"favicon": "./public/images/favicon.png"
|
||||
},
|
||||
"plugins": [
|
||||
"expo-router"
|
||||
|
||||
],
|
||||
"experiments": {
|
||||
"tsconfigPaths": true,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module.exports = function (api) {
|
||||
api.cache(true);
|
||||
return {
|
||||
presets: ['babel-preset-expo'],
|
||||
|
||||
plugins: ['nativewind/babel']
|
||||
};
|
||||
};
|
|
@ -16,7 +16,7 @@ export function Collapsible({ children, title }: PropsWithChildren & { title: st
|
|||
style={globalStylesheading}
|
||||
onPress={() => setIsOpen((value) => !value)}
|
||||
activeOpacity={0.8}>
|
||||
<Ionicons
|
||||
|
||||
name={isOpen ? 'chevron-down' : 'chevron-forward-outline'}
|
||||
size={18}
|
||||
color={theme === 'light' ? Colors.light.icon : Colors.dark.icon}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Link } from 'expo-router';
|
||||
import { openBrowserAsync } from 'expo-web-browser';
|
||||
import { type ComponentProps } from 'react';
|
||||
|
||||
import { Link } from 'lucide-react';
|
||||
import React, { type ComponentProps } from 'react';
|
||||
import { Platform } from 'react-native';
|
||||
|
||||
type Props = Omit<ComponentProps<typeof Link>, 'href'> & { href: string };
|
||||
|
@ -11,14 +11,7 @@ export function ExternalLink({ href, ...rest }: Props) {
|
|||
target="_blank"
|
||||
{...rest}
|
||||
href={href}
|
||||
onPress={async (event) => {
|
||||
if (Platform.OS !== 'web') {
|
||||
// Prevent the default behavior of linking to the default browser on native.
|
||||
event.preventDefault();
|
||||
// Open the link in an in-app browser.
|
||||
await openBrowserAsync(href);
|
||||
}
|
||||
}}
|
||||
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -5,5 +5,5 @@ import { type IconProps } from '@expo/vector-icons/build/createIconSet';
|
|||
import { type ComponentProps } from 'react';
|
||||
|
||||
export function TabBarIcon({ style, ...rest }: IconProps<ComponentProps<typeof Ionicons>['name']>) {
|
||||
return <Ionicons size={28} style={[{ marginBottom: -3 }, style]} {...rest} />;
|
||||
return
|
||||
}
|
||||
|
|
29
package.json
29
package.json
|
@ -12,12 +12,6 @@
|
|||
"dependencies": {
|
||||
"@babel/runtime": "7.26.0",
|
||||
"@hookform/resolvers": "3.9.1",
|
||||
"@react-native-async-storage/async-storage": "2.1.0",
|
||||
"@react-native-community/datetimepicker": "8.2.0",
|
||||
"@react-native-community/slider": "4.5.5",
|
||||
"@react-native-picker/picker": "2.9.0",
|
||||
"@react-navigation/native": "6.x",
|
||||
"@react-navigation/stack": "6.x",
|
||||
"@tauri-apps/api": "2",
|
||||
"@tauri-apps/plugin-opener": "2",
|
||||
"@zitadel/react": "1.0.5",
|
||||
|
@ -25,22 +19,12 @@
|
|||
"botframework-directlinejs": "0.15.1",
|
||||
"botframework-webchat": "4.15.7",
|
||||
"date-fns": "2.30.0",
|
||||
"lucide-react-native": "0.469.0",
|
||||
|
||||
"lucide-react": "0.454.0",
|
||||
"nativewind": "2.0.10",
|
||||
"postcss": "8.4.35",
|
||||
"react-dom": "18.3.1",
|
||||
"react-hook-form": "7.53.2",
|
||||
"react-native-chart-kit": "6.12.0",
|
||||
"react-native-elements": "3.4.3",
|
||||
"react-native-gesture-handler": "2.16.1",
|
||||
"react-native-linear-gradient": "2.8.3",
|
||||
"react-native-markdown-display": "7.0.0-alpha.2",
|
||||
"react-native-reanimated": "3.10.1",
|
||||
"react-native-safe-area-context": "4.10.5",
|
||||
"react-native-screens": "3.31.1",
|
||||
"react-native-web": "0.19.6",
|
||||
"react-native": "0.74.5",
|
||||
"react": "18.3.1",
|
||||
"tailwindcss": "3.4.1",
|
||||
"uuid": "11.0.3",
|
||||
|
@ -48,19 +32,18 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.18.6",
|
||||
"@tauri-apps/cli": "2",
|
||||
"@types/jest": "29.5.12",
|
||||
"@types/react-dom": "18.3.1",
|
||||
"@types/react-test-renderer": "18.0.7",
|
||||
"@types/react": "18.3.1",
|
||||
"@vitejs/plugin-react": "4.3.4",
|
||||
"copy-webpack-plugin": "12.0.2",
|
||||
"jest": "29.2.1",
|
||||
"jest-expo": "51.0.3",
|
||||
"postcss": "8.4.23",
|
||||
"react-test-renderer": "18.2.0",
|
||||
"tailwindcss": "3.1.8",
|
||||
"@types/react": "18.3.1",
|
||||
"@types/react-dom": "18.3.1",
|
||||
"@vitejs/plugin-react": "4.3.4",
|
||||
"typescript": "5.6.2",
|
||||
"vite": "6.0.3",
|
||||
"@tauri-apps/cli": "2"
|
||||
"vite": "6.0.3"
|
||||
}
|
||||
}
|
3999
pnpm-lock.yaml
generated
3999
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
@ -1,8 +1,6 @@
|
|||
import React, { useState } from 'react';
|
||||
import { View, Text, Image, StyleSheet, TouchableOpacity, ScrollView, Alert } from 'react-native';
|
||||
import { SafeAreaView } from 'react-native-safe-area-context';
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
import { ZitadelAuth } from '@zitadel/react';
|
||||
import { Auth as ZitadelAuth } from '@zitadel/react';
|
||||
|
||||
const AuthenticationScreen = () => {
|
||||
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
import { Asset } from 'expo-asset';
|
||||
import * as FileSystem from 'expo-file-system';
|
||||
|
||||
export async function ensureAssetLoaded(assetPath: string): Promise<string> {
|
||||
try {
|
||||
const asset = Asset.fromModule(assetPath);
|
||||
if (!asset.localUri) {
|
||||
await asset.downloadAsync();
|
||||
}
|
||||
return asset.localUri;
|
||||
} catch (error) {
|
||||
console.error('Failed to load asset:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function cacheAssets(assets: string[]): Promise<void> {
|
||||
try {
|
||||
const cacheDirectory = `${FileSystem.cacheDirectory}sounds/`;
|
||||
await FileSystem.makeDirectoryAsync(cacheDirectory, { intermediates: true });
|
||||
|
||||
await Promise.all(
|
||||
assets.map(async (asset) => {
|
||||
const assetName = asset.split('/').pop();
|
||||
const cachedPath = `${cacheDirectory}${assetName}`;
|
||||
|
||||
const fileInfo = await FileSystem.getInfoAsync(cachedPath);
|
||||
if (!fileInfo.exists) {
|
||||
await FileSystem.copyAsync({
|
||||
from: asset,
|
||||
to: cachedPath,
|
||||
});
|
||||
}
|
||||
})
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('Failed to cache assets:', error);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
// app/index.tsx
|
||||
import React from 'react';
|
||||
import {
|
||||
View,
|
||||
SafeAreaView,
|
||||
|
@ -9,12 +8,9 @@ import {
|
|||
Linking,
|
||||
StyleSheet,
|
||||
} from 'react-native';
|
||||
import { ClerkProvider, ClerkLoaded } from '@clerk/clerk-expo';
|
||||
import { useNavigation, useRoute } from '@react-navigation/native';
|
||||
import { createStackNavigator } from '@react-navigation/stack';
|
||||
import { StatusBar } from 'expo-status-bar';
|
||||
import { globalStyles } from '../styles.js';
|
||||
import { Image } from 'react-native';
|
||||
import { globalStyles } from '../styles';
|
||||
import { styled } from 'nativewind';
|
||||
import AuthenticationScreen from './authentication';
|
||||
import {Chat} from './chat';
|
||||
|
|
|
@ -7,9 +7,8 @@ import {
|
|||
TouchableOpacity,
|
||||
TextInput,
|
||||
} from 'react-native';
|
||||
import { Ionicons } from '@expo/vector-icons';
|
||||
|
||||
import { AccountSwitcher } from './account-switcher';
|
||||
|
||||
import { MailDisplay } from './mail-display';
|
||||
import { MailList } from './mail-list';
|
||||
import { Nav } from './nav';
|
||||
|
@ -21,7 +20,7 @@ interface MailProps {
|
|||
email: string;
|
||||
icon: React.ReactNode;
|
||||
}[];
|
||||
mails: Mail[];
|
||||
mails: [];
|
||||
}
|
||||
|
||||
export function Mail({ accounts, mails }: MailProps) {
|
||||
|
@ -35,7 +34,7 @@ export function Mail({ accounts, mails }: MailProps) {
|
|||
<View style={styles.container}>
|
||||
<View style={[styles.sidebar, isCollapsed && styles.collapsedSidebar]}>
|
||||
<TouchableOpacity onPress={toggleCollapse} style={styles.collapseButton}>
|
||||
<Ionicons name={isCollapsed ? 'menu' : 'menu-outline'} size={24} color="black" />
|
||||
|
||||
</TouchableOpacity>
|
||||
{!isCollapsed && (
|
||||
<>
|
||||
|
@ -62,7 +61,7 @@ export function Mail({ accounts, mails }: MailProps) {
|
|||
</View>
|
||||
</View>
|
||||
<View style={styles.searchContainer}>
|
||||
<Ionicons name="search" size={20} color="gray" style={styles.searchIcon} />
|
||||
|
||||
<TextInput
|
||||
style={styles.searchInput}
|
||||
placeholder="Search"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState } from 'react';
|
||||
import { View, Text, FlatList, TouchableOpacity, StyleSheet } from 'react-native';
|
||||
import { Ionicons } from '@expo/vector-icons';
|
||||
|
||||
import { Task } from '../data/schema';
|
||||
import { labels, priorities, statuses } from '../data/data';
|
||||
import { DataTableToolbar } from './DataTableToolbar';
|
||||
|
@ -28,15 +28,15 @@ export const DataTable: React.FC<DataTableProps> = ({ data }) => {
|
|||
<Text>{item.title}</Text>
|
||||
</View>
|
||||
<View style={styles.cell}>
|
||||
<Ionicons name={status?.icon as any} size={16} color="gray" />
|
||||
|
||||
<Text>{status?.label}</Text>
|
||||
</View>
|
||||
<View style={styles.cell}>
|
||||
<Ionicons name={priority?.icon as any} size={16} color="gray" />
|
||||
|
||||
<Text>{priority?.label}</Text>
|
||||
</View>
|
||||
<TouchableOpacity style={styles.cell}>
|
||||
<Ionicons name="ellipsis-horizontal" size={16} color="gray" />
|
||||
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
|
||||
import { Ionicons } from '@expo/vector-icons';
|
||||
|
||||
|
||||
interface DataTablePaginationProps {
|
||||
page: number;
|
||||
|
@ -24,17 +24,17 @@ export const DataTablePagination: React.FC<DataTablePaginationProps> = ({
|
|||
<Text>{}</Text>
|
||||
<View style={styles.navigation}>
|
||||
<TouchableOpacity onPress={() => setPage(0)} disabled={page === 0}>
|
||||
<Ionicons name="chevron-back-outline" size={24} color={page === 0 ? 'gray' : 'black'} />
|
||||
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity onPress={() => setPage(page - 1)} disabled={page === 0}>
|
||||
<Ionicons name="chevron-back-outline" size={24} color={page === 0 ? 'gray' : 'black'} />
|
||||
|
||||
</TouchableOpacity>
|
||||
<Text>{}</Text>
|
||||
<TouchableOpacity onPress={() => setPage(page + 1)} disabled={page === totalPages - 1}>
|
||||
<Ionicons name="chevron-forward-outline" size={24} color={page === totalPages - 1 ? 'gray' : 'black'} />
|
||||
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity onPress={() => setPage(totalPages - 1)} disabled={page === totalPages - 1}>
|
||||
<Ionicons name="chevron-forward-outline" size={24} color={page === totalPages - 1 ? 'gray' : 'black'} />
|
||||
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState } from 'react';
|
||||
import { View, TextInput, TouchableOpacity, Text, StyleSheet } from 'react-native';
|
||||
import { Ionicons } from '@expo/vector-icons';
|
||||
|
||||
import { Task } from '../data/schema';
|
||||
import { priorities, statuses } from '../data/data';
|
||||
|
||||
|
@ -44,11 +44,11 @@ export const DataTableToolbar: React.FC<DataTableToolbarProps> = ({ onFilter, da
|
|||
/>
|
||||
<View style={styles.filterContainer}>
|
||||
<TouchableOpacity onPress={() => {}} style={styles.filterButton}>
|
||||
<Ionicons name="funnel-outline" size={16} color="gray" />
|
||||
|
||||
<Text>Status</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity onPress={() => {}} style={styles.filterButton}>
|
||||
<Ionicons name="funnel-outline" size={16} color="gray" />
|
||||
|
||||
<Text>Priority</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import React from 'react';
|
||||
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
|
||||
import { Ionicons } from '@expo/vector-icons';
|
||||
|
||||
|
||||
export const UserNav: React.FC = () => {
|
||||
return (
|
||||
<TouchableOpacity style={styles.container}>
|
||||
<Ionicons name="person-circle-outline" size={32} color="gray" />
|
||||
|
||||
<View style={styles.userInfo}>
|
||||
<Text style={styles.userName}>John Doe</Text>
|
||||
<Text style={styles.userEmail}>john@example.com</Text>
|
||||
</View>
|
||||
<Ionicons name="chevron-down-outline" size={24} color="gray" />
|
||||
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Ionicons } from '@expo/vector-icons';
|
||||
|
||||
|
||||
export const labels = [
|
||||
{
|
||||
|
|
201
styles.js
Normal file
201
styles.js
Normal file
|
@ -0,0 +1,201 @@
|
|||
import { StyleSheet } from 'react-native';
|
||||
|
||||
export const colors = {
|
||||
|
||||
primary: '#8A4FFF',
|
||||
secondary: '#FFD700',
|
||||
background: '#2A1B3D',
|
||||
white: '#FFFFFF',
|
||||
purple: {
|
||||
dark: '#1A0B2E',
|
||||
medium: '#431E6E',
|
||||
light: '#8A4FFF'
|
||||
},
|
||||
gold: {
|
||||
light: '#FFD700',
|
||||
medium: '#DAA520',
|
||||
dark: '#B8860B'
|
||||
}
|
||||
};
|
||||
|
||||
const glassEffect = {
|
||||
backgroundColor: 'rgba(255, 255, 255, 0.1)',
|
||||
backdropFilter: 'blur(10px)',
|
||||
};
|
||||
|
||||
export const globalStyles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
// Other global container styles
|
||||
},
|
||||
backgroundArcImage: {
|
||||
position: 'absolute',
|
||||
width: '355px',
|
||||
height: '380px',
|
||||
|
||||
// Other global background image styles
|
||||
},
|
||||
backgroundImage: {
|
||||
position: 'absolute',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
// Other global background image styles
|
||||
},
|
||||
safeArea: {
|
||||
flex: 1,
|
||||
// Other global safe area styles
|
||||
},
|
||||
topNavContainer: {
|
||||
width: '100%',
|
||||
backgroundColor: 'transparent',
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
},
|
||||
innerNavContainer: {
|
||||
width: '90%',
|
||||
paddingTop: 20,
|
||||
marginTop: -30,
|
||||
borderRadius: 20,
|
||||
height: 85,
|
||||
marginLeft: '5%',
|
||||
marginRight: '5%',
|
||||
paddingRight: '20px',
|
||||
|
||||
paddingLeft: '20px',
|
||||
backgroundColor: 'white',
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
},
|
||||
logoImage: {
|
||||
left: 8,
|
||||
top:4,
|
||||
width: 80,
|
||||
height: 20,
|
||||
},
|
||||
instagramIcon: {
|
||||
right: 10,
|
||||
width: 16,
|
||||
height: 16,
|
||||
},
|
||||
|
||||
link:{
|
||||
color:'white'
|
||||
},
|
||||
|
||||
headerView:{
|
||||
display: 'inline'
|
||||
|
||||
},
|
||||
logo: {
|
||||
width: 48,
|
||||
height: 48,
|
||||
marginLeft: 8,
|
||||
marginRight: 12,
|
||||
borderRadius: 8,
|
||||
backgroundColor: '#f0f0f0',
|
||||
},
|
||||
// Layout styles
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: 'white'
|
||||
},
|
||||
|
||||
safeArea: {
|
||||
flex: 1,
|
||||
},
|
||||
|
||||
backgroundImage: {
|
||||
top:0,
|
||||
position: 'absolute',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
resizeMode: 'cover',
|
||||
},
|
||||
backgroundImageForm: {
|
||||
|
||||
},
|
||||
|
||||
|
||||
contentContainer: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
|
||||
},
|
||||
|
||||
card: {
|
||||
width: '100%',
|
||||
maxWidth: 400,
|
||||
padding: 15,
|
||||
borderRadius: 15,
|
||||
...glassEffect,
|
||||
borderWidth: 1,
|
||||
borderColor: 'rgba(255, 255, 255, 0.1)',
|
||||
},
|
||||
|
||||
// Text styles
|
||||
title: {
|
||||
fontSize: 18,
|
||||
flexWrap: 'nowrap',
|
||||
fontWeight: '600',
|
||||
marginBottom: 8,
|
||||
textAlign: 'center',
|
||||
color: colors.white,
|
||||
letterSpacing: 0.5,
|
||||
},
|
||||
|
||||
subtitle: {
|
||||
fontSize: 14,
|
||||
marginBottom: 25,
|
||||
textAlign: 'center',
|
||||
color: 'rgba(255, 255, 255, 0.8)',
|
||||
letterSpacing: 0.3,
|
||||
},
|
||||
|
||||
// Input styles
|
||||
input: {
|
||||
width: '90%',
|
||||
height: 38,
|
||||
textAlign: 'center',
|
||||
borderRadius: 8,
|
||||
paddingHorizontal: 15,
|
||||
marginBottom: 5,
|
||||
marginRight: '5%',
|
||||
marginLeft: '5%',
|
||||
fontSize: 16,
|
||||
backgroundColor: 'white',
|
||||
color: colors.gray,
|
||||
borderWidth: 1,
|
||||
borderColor: 'rgba(255, 255, 255, 0.15)',
|
||||
},
|
||||
button: {
|
||||
marginTop: 20,
|
||||
paddingVertical: 12,
|
||||
marginLeft:16,
|
||||
marginRight: 16,
|
||||
borderRadius: 10,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
backgroundColor: '#A855F7', // fallback color
|
||||
// Add gradient-like effect using background image
|
||||
backgroundImage: 'linear-gradient(to right, #7859a9, #deb99b)',
|
||||
},
|
||||
buttonText: {
|
||||
color: '#FFFFFF',
|
||||
fontSize: 16,
|
||||
fontWeight: 'bold',
|
||||
},
|
||||
disabledButton: {
|
||||
opacity: 0.7,
|
||||
},
|
||||
// Particle effects container
|
||||
particleContainer: {
|
||||
position: 'absolute',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
pointerEvents: 'none',
|
||||
},
|
||||
|
||||
|
||||
})
|
|
@ -5,6 +5,7 @@
|
|||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
|
@ -15,7 +16,7 @@
|
|||
"jsx": "react-jsx",
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"strict": false,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
|
|
Loading…
Add table
Reference in a new issue