-
-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix icon, update display name, search in toolbar
- Loading branch information
Showing
22 changed files
with
249 additions
and
48 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,16 @@ | ||
// | ||
// NSTextField.swift | ||
// RedditOs | ||
// | ||
// Created by Thomas Ricouard on 28/07/2020. | ||
// | ||
|
||
import Foundation | ||
import AppKit | ||
|
||
extension NSTextField { | ||
open override var focusRingType: NSFocusRingType { | ||
get { .none } | ||
set { } | ||
} | ||
} |
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
45 changes: 45 additions & 0 deletions
45
RedditOs/Features/Search/Subreddit Popover/PopoverSearchSubredditView.swift
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,45 @@ | ||
// | ||
// SearchSubredditsPopover.swift | ||
// RedditOs | ||
// | ||
// Created by Thomas Ricouard on 09/07/2020. | ||
// | ||
|
||
import SwiftUI | ||
import Backend | ||
|
||
struct PopoverSearchSubredditView: View { | ||
@EnvironmentObject private var userData: LocalDataStore | ||
@StateObject private var viewModel = PopoverSearchSubredditViewModel() | ||
|
||
var body: some View { | ||
List { | ||
TextField("Search", text: $viewModel.searchText) | ||
.textFieldStyle(RoundedBorderTextFieldStyle()) | ||
.padding(.vertical, 8) | ||
if viewModel.isLoading { | ||
LoadingRow(text: nil) | ||
} else if let results = viewModel.results { | ||
ForEach(results) { result in | ||
PopoverSearchSubredditRow(subreddit: result).onTapGesture { | ||
userData.add(favorite: result) | ||
} | ||
} | ||
} | ||
} | ||
.navigationTitle("Search") | ||
.toolbar { | ||
ToolbarItem(placement: .navigation) { | ||
Button(action: {}) { | ||
Image(systemName: "xmark.circle") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
struct SearchSheet_Previews: PreviewProvider { | ||
static var previews: some View { | ||
PopoverSearchSubredditView() | ||
} | ||
} |
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,34 @@ | ||
// | ||
// ToolbarSearchBar.swift | ||
// RedditOs | ||
// | ||
// Created by Thomas Ricouard on 28/07/2020. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ToolbarSearchBar: View { | ||
@State private var isFocused = false | ||
@State private var searchText = "" | ||
|
||
var body: some View { | ||
TextField("Search anything", text: $searchText) { editing in | ||
isFocused = editing | ||
} onCommit: { | ||
|
||
} | ||
.keyboardShortcut("f", modifiers: .command) | ||
.padding(8) | ||
.background(RoundedRectangle(cornerRadius: 8) | ||
.stroke(isFocused ? Color.accentColor : Color.clear) | ||
.background(Color.black.opacity(0.2).cornerRadius(8))) | ||
.textFieldStyle(PlainTextFieldStyle()) | ||
.frame(width: 500) | ||
} | ||
} | ||
|
||
struct ToolbarSearchBar_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ToolbarSearchBar() | ||
} | ||
} |
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,78 @@ | ||
// | ||
// SettingsView.swift | ||
// RedditOs | ||
// | ||
// Created by Thomas Ricouard on 26/07/2020. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct SettingsView: View { | ||
var body: some View { | ||
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) | ||
.toolbar { | ||
ToolbarItem { | ||
Button(action: { | ||
|
||
}, label: { | ||
VStack { | ||
Image(systemName: "gearshape").imageScale(.large) | ||
Text("General") | ||
} | ||
}) | ||
} | ||
|
||
ToolbarItem { | ||
Button(action: { | ||
|
||
}, label: { | ||
VStack { | ||
Image(systemName: "textformat.alt").imageScale(.large) | ||
Text("Apperance") | ||
} | ||
}) | ||
} | ||
|
||
|
||
ToolbarItem { | ||
Button(action: { | ||
|
||
}, label: { | ||
VStack { | ||
Image(systemName: "stop.circle").imageScale(.large) | ||
Text("Filters") | ||
} | ||
}) | ||
} | ||
|
||
ToolbarItem { | ||
Button(action: { | ||
|
||
}, label: { | ||
VStack { | ||
Image(systemName: "magnifyingglass").imageScale(.large) | ||
Text("Search") | ||
} | ||
}) | ||
} | ||
|
||
|
||
ToolbarItem { | ||
Button(action: { | ||
|
||
}, label: { | ||
VStack { | ||
Image(systemName: "person").imageScale(.large) | ||
Text("Accounts") | ||
} | ||
}) | ||
} | ||
}.frame(width: 1000, height: 500) | ||
} | ||
} | ||
|
||
struct SettingsView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
SettingsView() | ||
} | ||
} |
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
Binary file not shown.