Skip to content

Commit e6a6ad1

Browse files
committed
Added "ToolBarItem" and Fixed "enableEditing error" 🚀
1 parent 7d96a82 commit e6a6ad1

File tree

14 files changed

+277
-113
lines changed

14 files changed

+277
-113
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ __tests__
1313
/android/build/
1414
/example/
1515
/docs/
16+
/assets/

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<p align="center">
2-
<img src="./assets/mockup.png" alt="SwiftUI Native Logo" width="400px" />
2+
<img src="https://raw.githubusercontent.com/rit3zh/swiftui-native/refs/heads/main/assets/mockup.png" alt="SwiftUI Native Logo" width="400px" />
33
</p>
44
<p align="center">
5-
<img src="./assets/swiftui-rn-logo.png" alt="SwiftUI Native Logo" width="300px" />
5+
<img src="https://github.com/rit3zh/swiftui-native/blob/main/assets/swiftui-rn-logo.png?raw=true" alt="SwiftUI Native Logo" width="300px" />
66
</p>
77

88
<div align="center">
@@ -82,16 +82,17 @@ This package supports React Native’s [autolinking](https://github.com/react-na
8282

8383
---
8484

85-
8685
## Preview 🎬
8786

8887
<video controls width="100%">
89-
<source src="./assets/recording.mov" type="video/mp4" />
88+
<source src="./assets/recording.mp4" type="video/mp4" />
9089
🛑 Whoops—your browser doesn’t support the video tag!
9190
</video>
9291

92+
### 📝 **Changes**
9393

94-
94+
- ✅ Fixed `enableEditing` error
95+
- ➕ Added `ToolBarItem` component
9596

9697
### 🤝 Contributing
9798

assets/recording.mov

-50.1 MB
Binary file not shown.

assets/recording.mp4

5.21 MB
Binary file not shown.

example/App.tsx

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
11
import React from "react";
22
import { Contacts, GoalScreen, Playlist, Settings } from "./src/screens";
3-
import SwiftUI from "swiftui-native";
3+
import SwiftUI, { useSwiftUiEvent } from "swiftui-native";
44

55
const App: React.FunctionComponent = (): React.ReactNode => {
6+
useSwiftUiEvent("onEditToggle", (e) => {
7+
console.log(e);
8+
});
69
return (
710
<SwiftUI.RootView>
8-
<SwiftUI.List>
9-
<SwiftUI.CollapsibleSection
10-
optionalSubviews={<SwiftUI.Text>Section 1</SwiftUI.Text>}
11-
isExpandable={true}
11+
<SwiftUI.NavigationView title="Example">
12+
<SwiftUI.List
13+
listStyle="sidebar"
14+
leadingSwipeActionFullSwipeEnable
15+
trailingSwipeActionFullSwipeEnable
16+
trailingSwipeActions={[
17+
<SwiftUI.ListButton
18+
role="cancel"
19+
systemIconName="0.circle"
20+
text="red"
21+
/>,
22+
]}
23+
enableEditing={false}
1224
>
13-
<SwiftUI.Text>Section 1 Content</SwiftUI.Text>
14-
</SwiftUI.CollapsibleSection>
15-
</SwiftUI.List>
25+
<SwiftUI.CollapsibleSection
26+
isExpandable={true}
27+
optionalSubviews={[<SwiftUI.Text>Optional Subview</SwiftUI.Text>]}
28+
>
29+
<SwiftUI.Text>Hello</SwiftUI.Text>
30+
<SwiftUI.Text>Hello</SwiftUI.Text>
31+
<SwiftUI.Text>Hello</SwiftUI.Text>
32+
<SwiftUI.Text>Hello</SwiftUI.Text>
33+
<SwiftUI.Text>Hello</SwiftUI.Text>
34+
<SwiftUI.Text>Hello</SwiftUI.Text>
35+
</SwiftUI.CollapsibleSection>
36+
</SwiftUI.List>
37+
</SwiftUI.NavigationView>
1638
</SwiftUI.RootView>
1739
);
1840
};

0 commit comments

Comments
 (0)