mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-30 04:01:02 +00:00
Add translate button to the preview post in settings (#724)
* Add translate button to the preview post in settings * Accidental outdent. * Add share button to placeholder status and also preview status in settings.
This commit is contained in:
parent
e2a836e6e3
commit
a43a657f1e
2 changed files with 28 additions and 29 deletions
|
@ -12,9 +12,7 @@ struct DisplaySettingsView: View {
|
|||
@EnvironmentObject private var userPreferences: UserPreferences
|
||||
|
||||
@State private var isFontSelectorPresented = false
|
||||
|
||||
private var previewStatusViewModel = StatusRowViewModel(status: Status.placeholder(parseMarkdown: true))
|
||||
|
||||
private var previewStatusViewModel = StatusRowViewModel(status: Status.placeholder(forSettings: true, language: "la")) // translate from latin button
|
||||
var body: some View {
|
||||
Form {
|
||||
Section("settings.display.example-toot") {
|
||||
|
|
|
@ -100,9 +100,9 @@ public struct Status: AnyStatus, Codable, Identifiable, Equatable, Hashable, Sta
|
|||
public let sensitive: Bool
|
||||
public let language: String?
|
||||
|
||||
public static func placeholder(parseMarkdown:Bool = false) -> Status {
|
||||
public static func placeholder(forSettings:Bool = false, language:String? = nil) -> Status {
|
||||
.init(id: UUID().uuidString,
|
||||
content: .init(stringValue: "Lorem ipsum [#dolor](#) sit amet\nconsectetur [@adipiscing](#) elit\nAsed do eiusmod tempor incididunt ut labore.", parseMarkdown: parseMarkdown),
|
||||
content: .init(stringValue: "Lorem ipsum [#dolor](#) sit amet\nconsectetur [@adipiscing](#) elit\nAsed do eiusmod tempor incididunt ut labore.", parseMarkdown: forSettings),
|
||||
|
||||
account: .placeholder(),
|
||||
createdAt: ServerDate.sampleDate,
|
||||
|
@ -119,7 +119,7 @@ public struct Status: AnyStatus, Codable, Identifiable, Equatable, Hashable, Sta
|
|||
pinned: false,
|
||||
bookmarked: false,
|
||||
emojis: [],
|
||||
url: nil,
|
||||
url: "https://example.com",
|
||||
application: nil,
|
||||
inReplyToAccountId: nil,
|
||||
visibility: .pub,
|
||||
|
@ -127,9 +127,10 @@ public struct Status: AnyStatus, Codable, Identifiable, Equatable, Hashable, Sta
|
|||
spoilerText: .init(stringValue: ""),
|
||||
filtered: [],
|
||||
sensitive: false,
|
||||
language: nil)
|
||||
language: language)
|
||||
}
|
||||
|
||||
|
||||
public static func placeholders() -> [Status] {
|
||||
[.placeholder(), .placeholder(), .placeholder(), .placeholder(), .placeholder()]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue