-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1628 from planetary-social/welcome-to-feed-tip
#1602: Welcome to Your Feed tip
- Loading branch information
Showing
8 changed files
with
124 additions
and
25 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
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,12 @@ | ||
import TipKit | ||
|
||
/// A tip that's displayed on the Feed view, also known as the Home view. | ||
struct WelcomeToFeedTip: Tip { | ||
var title: Text { | ||
Text("welcomeToYourFeed") | ||
} | ||
|
||
var message: Text? { | ||
Text("nosDoesNotUseAlgorithms") | ||
} | ||
} |
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,33 @@ | ||
import TipKit | ||
|
||
/// An inline tip view style with a styled title, message, and close button. | ||
struct InlineTipViewStyle: TipViewStyle { | ||
func makeBody(configuration: TipViewStyle.Configuration) -> some View { | ||
VStack(alignment: .leading, spacing: 10) { | ||
HStack(alignment: .top) { | ||
configuration.title | ||
.font(.title2.bold()) | ||
.foregroundStyle(Color.primaryTxt) | ||
.shadow(color: .lightShadow, radius: 2, x: 0, y: 1) | ||
Spacer() | ||
Button { | ||
configuration.tip.invalidate(reason: .tipClosed) | ||
} label: { | ||
Image(systemName: "xmark").scaledToFit() | ||
.foregroundStyle(Color.primaryTxt) | ||
.font(.system(size: 20).bold()) | ||
} | ||
} | ||
|
||
configuration.message | ||
.foregroundStyle(Color.primaryTxt) | ||
.shadow(color: .lightShadow, radius: 2, x: 0, y: 1) | ||
} | ||
.padding(.vertical, 20) | ||
.padding(.horizontal, 16) | ||
} | ||
} | ||
|
||
extension TipViewStyle where Self == InlineTipViewStyle { | ||
static var inline: Self { Self() } | ||
} |
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