-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show bottom sheet to add new feeds on iOS - #91
- Loading branch information
Showing
15 changed files
with
263 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// CompatViewRoute.swift | ||
// FeedFlow | ||
// | ||
// Created by Marco Gomiero on 07/01/24. | ||
// Copyright © 2024. All rights reserved. | ||
// | ||
|
||
enum CompactViewRoute: Hashable { | ||
case feed | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// | ||
// NoFeedsBottomSheet.swift | ||
// FeedFlow | ||
// | ||
// Created by Marco Gomiero on 07/01/24. | ||
// Copyright © 2024. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct NoFeedsBottomSheet: View { | ||
|
||
@Environment(\.presentationMode) | ||
private var presentationMode | ||
|
||
let onAddFeedClick: () -> Void | ||
let onImportExportClick: () -> Void | ||
|
||
var preferredHeight: CGFloat = 400 | ||
|
||
var body: some View { | ||
NavigationStack { | ||
List { | ||
|
||
Section { | ||
Text(localizer.no_feed_modal_message.localized) | ||
.font(.body) | ||
.multilineTextAlignment(.leading) | ||
} | ||
|
||
Section { | ||
Button { | ||
onAddFeedClick() | ||
} label: { | ||
Label( | ||
localizer.add_feed.localized, | ||
systemImage: "plus.app" | ||
) | ||
} | ||
|
||
Button { | ||
onImportExportClick() | ||
} label: { | ||
Label( | ||
localizer.import_export_opml.localized, | ||
systemImage: "arrow.up.arrow.down" | ||
) | ||
} | ||
} | ||
} | ||
.listStyle(.insetGrouped) | ||
.scrollContentBackground(.hidden) | ||
.background(Color.secondaryBackgroundColor) | ||
.navigationTitle(localizer.no_feed_modal_title.localized) | ||
.navigationBarTitleDisplayMode(.inline) | ||
.toolbar { | ||
ToolbarItem(placement: .navigationBarTrailing) { | ||
Button { | ||
self.presentationMode.wrappedValue.dismiss() | ||
} label: { | ||
Text(localizer.action_done.localized).bold() | ||
} | ||
} | ||
} | ||
} | ||
.presentationDetents([.height(preferredHeight), .large]) | ||
} | ||
} | ||
|
||
#Preview { | ||
NoFeedsBottomSheet(onAddFeedClick: {}, onImportExportClick: {}) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.