Skip to content

Commit 30d07d2

Browse files
committed
HugeIcons direct component import
1 parent cc23a19 commit 30d07d2

File tree

349 files changed

+13206
-1444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

349 files changed

+13206
-1444
lines changed

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
src/rpc/
1+
src/rpc/
2+
src/assets/icons/hugeicons/

App.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
import { devOptStore } from '@/zustand/devOptStore'
2-
import { CodeSolidIcon } from '@assets/icons/icons'
32
import { Popups } from '@components/Popup'
43
import Press from '@components/Press'
54
import { AutoStatusBar } from '@components/StatusBar'
5+
import CodeIcon from '@hugeicons/CodeIcon'
66
import { queryClient } from '@query/index'
77
import { NavigationContainer, useNavigation } from '@react-navigation/native'
88
import { CardStyleInterpolators, createStackNavigator, type StackNavigationOptions } from '@react-navigation/stack'
99
import ComputerScienceSettings from '@screens/ComputerScience/ComputerScienceSettings'
10-
import { LocationNoteParamList } from '@screens/LocationNotes/LocationNote'
11-
import LocationNotes from '@screens/LocationNotes/LocationNotes'
12-
import LocationNote from '@screens/LocationNotes/LocationNote'
13-
import LocationTags from '@screens/LocationNotes/LocationTags'
1410
import DeveloperOptions from '@screens/DeveloperOptions/DeveloperOptions'
1511
import MMKVDataEditor, { type MMKVDataEditorParamList } from '@screens/DeveloperOptions/MMKVDataEditor'
1612
import MMKVDataList from '@screens/DeveloperOptions/MMKVDataList'
1713
import Skia from '@screens/Example/Skia'
1814
import Explore from '@screens/Explore/Explore'
1915
import Greeting from '@screens/Home/Greeting'
2016
import fabStyles from '@screens/Home/styles/fabStyles'
17+
import LocationNote, { LocationNoteParamList } from '@screens/LocationNotes/LocationNote'
18+
import LocationNotes from '@screens/LocationNotes/LocationNotes'
19+
import LocationTags from '@screens/LocationNotes/LocationTags'
20+
import NewLocationNote from '@screens/LocationNotes/NewLocationNote'
21+
import LocationSpeed from '@screens/LocationSpeed/LocationSpeed'
2122
import NotesWelcome from '@screens/Notes/NotesWelcome'
2223
import type { ChartParamList } from '@screens/OS/Chart'
2324
import Chart from '@screens/OS/Chart'
@@ -62,8 +63,6 @@ import { Dimensions, SafeAreaView, useColorScheme } from 'react-native'
6263
import { GestureHandlerRootView } from 'react-native-gesture-handler'
6364
import Animated, { ZoomIn, ZoomOut } from 'react-native-reanimated'
6465
import './global.css'
65-
import NewLocationNote from '@screens/LocationNotes/NewLocationNote'
66-
import LocationSpeed from '@screens/LocationSpeed/LocationSpeed'
6766

6867
function App(): React.JSX.Element {
6968
const scheme = useColorScheme()
@@ -294,7 +293,7 @@ const FabButton = () => {
294293
activeScale={0.95}
295294
className='items-center justify-center rounded-full bg-accent'
296295
>
297-
<CodeSolidIcon color={'white'} height={25} width={25} />
296+
<CodeIcon color={'white'} size={25} />
298297
</Press>
299298
</Animated.View>
300299
)

ic.ts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import { execSync } from 'node:child_process'
2+
import { readdirSync, statSync } from 'node:fs'
3+
import { join } from 'node:path'
4+
5+
// Function to recursively get all .svg files in a directory
6+
function getSvgFiles(directory: string): string[] {
7+
const files: string[] = []
8+
9+
const items = readdirSync(directory)
10+
11+
for (const item of items) {
12+
const fullPath = join(directory, item)
13+
const stats = statSync(fullPath)
14+
15+
if (stats.isDirectory()) {
16+
files.push(...getSvgFiles(fullPath))
17+
} else if (item.endsWith('.svg')) {
18+
files.push(fullPath)
19+
}
20+
}
21+
22+
return files
23+
}
24+
25+
// Function to transform filename by removing last two words and .svg extension
26+
function transformFilename(filePath: string): string {
27+
const fileName = filePath.split('/').pop()?.split('\\').pop() ?? ''
28+
29+
// Remove .svg extension first
30+
const nameWithoutExt = fileName.replace('.svg', '')
31+
32+
// Split by underscores or hyphens to get words
33+
const separator = nameWithoutExt.includes('-') ? '-' : '_'
34+
const words = nameWithoutExt.split(separator)
35+
36+
// Remove the last two words if there are at least 3 words
37+
if (words.length >= 3) {
38+
words.splice(-2)
39+
}
40+
41+
// Join the remaining words
42+
return words.join(separator)
43+
}
44+
45+
// Main function
46+
async function main() {
47+
try {
48+
const iconsDir = join(process.cwd(), 'src', 'assets', 'icons', 'src')
49+
const svgFiles = getSvgFiles(iconsDir)
50+
51+
console.log(`Found ${svgFiles.length} SVG files in the icons directory.`)
52+
53+
for (const file of svgFiles) {
54+
const transformedName = transformFilename(file)
55+
console.log(`Processing ${file} -> ${transformedName}`)
56+
57+
try {
58+
// Run the ic command with the transformed filename
59+
execSync(`ic ${transformedName}`, { stdio: 'inherit' })
60+
} catch (error) {
61+
console.error(`Failed to process ${file}:`, error)
62+
}
63+
}
64+
65+
console.log('Processing completed.')
66+
} catch (error) {
67+
console.error('An error occurred:', error)
68+
process.exit(1)
69+
}
70+
}
71+
72+
main()

src/assets/icons/hugeicons/Add01Icon.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
import React from 'react'
3-
import Svg, { Circle, ClipPath, Defs, Ellipse, G, Line, LinearGradient, Mask, Path, Polygon, Polyline, RadialGradient, Rect, Stop } from 'react-native-svg'
4-
import { Variant, IconProps, defaultStrokeWidth, defaultVariant, defaultColor, defaultSize } from './constants'
3+
import Svg, { Path } from 'react-native-svg'
4+
import { HugeIconProps, Variant, defaultColor, defaultSize, defaultStrokeWidth, defaultVariant } from './constants'
55

6-
const iconMap: Record<Variant, React.FC<IconProps>> = {
6+
const iconMap: Record<Variant, React.FC<HugeIconProps>> = {
77
'stroke-rounded': StrokeRounded,
88
'stroke-standard': StrokeStandard,
99
'solid-standard': SolidStandard,
@@ -15,75 +15,75 @@ const iconMap: Record<Variant, React.FC<IconProps>> = {
1515
'solid-sharp': SolidSharp,
1616
}
1717

18-
export default function Add01Icon({ variant, ...rest }: IconProps) {
18+
export default function Add01Icon({ variant, ...rest }: HugeIconProps) {
1919
const Component = iconMap[variant || defaultVariant]
2020
return <Component {...rest} />
2121
}
2222

23-
function StrokeRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
23+
function StrokeRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: HugeIconProps) {
2424
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
2525
<Path d="M12 4V20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
2626
<Path d="M4 12H20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
2727
</Svg>
2828
)
2929
}
3030

31-
function StrokeStandard({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
31+
function StrokeStandard({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: HugeIconProps) {
3232
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
3333
<Path d="M12 4V20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
3434
<Path d="M4 12H20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
3535
</Svg>
3636
)
3737
}
3838

39-
function SolidStandard({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
39+
function SolidStandard({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: HugeIconProps) {
4040
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
4141
<Path fillRule="evenodd" clipRule="evenodd" d="M12 2.75C12.6904 2.75 13.25 3.30964 13.25 4V20C13.25 20.6904 12.6904 21.25 12 21.25C11.3096 21.25 10.75 20.6904 10.75 20V4C10.75 3.30964 11.3096 2.75 12 2.75Z" fill={color}/>
4242
<Path fillRule="evenodd" clipRule="evenodd" d="M2.75 12C2.75 11.3096 3.30964 10.75 4 10.75H20C20.6904 10.75 21.25 11.3096 21.25 12C21.25 12.6904 20.6904 13.25 20 13.25H4C3.30964 13.25 2.75 12.6904 2.75 12Z" fill={color}/>
4343
</Svg>
4444
)
4545
}
4646

47-
function DuotoneRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
47+
function DuotoneRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: HugeIconProps) {
4848
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
4949
<Path opacity="0.4" d="M12 4V20M4 12H20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
5050
</Svg>
5151
)
5252
}
5353

54-
function TwotoneRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
54+
function TwotoneRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: HugeIconProps) {
5555
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
5656
<Path d="M12 4V20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
5757
<Path opacity="0.4" d="M4 12H20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
5858
</Svg>
5959
)
6060
}
6161

62-
function SolidRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
62+
function SolidRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: HugeIconProps) {
6363
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
6464
<Path fillRule="evenodd" clipRule="evenodd" d="M12 2.75C12.6904 2.75 13.25 3.30964 13.25 4V20C13.25 20.6904 12.6904 21.25 12 21.25C11.3096 21.25 10.75 20.6904 10.75 20V4C10.75 3.30964 11.3096 2.75 12 2.75Z" fill={color}/>
6565
<Path fillRule="evenodd" clipRule="evenodd" d="M2.75 12C2.75 11.3096 3.30964 10.75 4 10.75H20C20.6904 10.75 21.25 11.3096 21.25 12C21.25 12.6904 20.6904 13.25 20 13.25H4C3.30964 13.25 2.75 12.6904 2.75 12Z" fill={color}/>
6666
</Svg>
6767
)
6868
}
6969

70-
function BulkRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
70+
function BulkRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: HugeIconProps) {
7171
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
7272
<Path fillRule="evenodd" clipRule="evenodd" d="M12 2.75C12.6904 2.75 13.25 3.30964 13.25 4V20C13.25 20.6904 12.6904 21.25 12 21.25C11.3096 21.25 10.75 20.6904 10.75 20V4C10.75 3.30964 11.3096 2.75 12 2.75Z" fill={color}/>
7373
<Path opacity="0.4" fillRule="evenodd" clipRule="evenodd" d="M2.75 12C2.75 11.3096 3.30964 10.75 4 10.75H20C20.6904 10.75 21.25 11.3096 21.25 12C21.25 12.6904 20.6904 13.25 20 13.25H4C3.30964 13.25 2.75 12.6904 2.75 12Z" fill={color}/>
7474
</Svg>
7575
)
7676
}
7777

78-
function StrokeSharp({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
78+
function StrokeSharp({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: HugeIconProps) {
7979
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
8080
<Path d="M12 4V20" stroke={color} strokeWidth={strokeWidth} strokeLinejoin="round"/>
8181
<Path d="M4 12H20" stroke={color} strokeWidth={strokeWidth} strokeLinejoin="round"/>
8282
</Svg>
8383
)
8484
}
8585

86-
function SolidSharp({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
86+
function SolidSharp({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: HugeIconProps) {
8787
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
8888
<Path d="M10.75 13.25V20H13.25V13.25H20V10.75H13.25V4H10.75V10.75H4V13.25H10.75Z" fill={color}/>
8989
</Svg>

0 commit comments

Comments
 (0)