mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-27 09:30:37 +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,36 +100,37 @@ 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,
|
||||
editedAt: nil,
|
||||
reblog: nil,
|
||||
mediaAttachments: [],
|
||||
mentions: [],
|
||||
repliesCount: 0,
|
||||
reblogsCount: 0,
|
||||
favouritesCount: 0,
|
||||
card: nil,
|
||||
favourited: false,
|
||||
reblogged: false,
|
||||
pinned: false,
|
||||
bookmarked: false,
|
||||
emojis: [],
|
||||
url: nil,
|
||||
application: nil,
|
||||
inReplyToAccountId: nil,
|
||||
visibility: .pub,
|
||||
poll: nil,
|
||||
spoilerText: .init(stringValue: ""),
|
||||
filtered: [],
|
||||
sensitive: false,
|
||||
language: nil)
|
||||
account: .placeholder(),
|
||||
createdAt: ServerDate.sampleDate,
|
||||
editedAt: nil,
|
||||
reblog: nil,
|
||||
mediaAttachments: [],
|
||||
mentions: [],
|
||||
repliesCount: 0,
|
||||
reblogsCount: 0,
|
||||
favouritesCount: 0,
|
||||
card: nil,
|
||||
favourited: false,
|
||||
reblogged: false,
|
||||
pinned: false,
|
||||
bookmarked: false,
|
||||
emojis: [],
|
||||
url: "https://example.com",
|
||||
application: nil,
|
||||
inReplyToAccountId: nil,
|
||||
visibility: .pub,
|
||||
poll: nil,
|
||||
spoilerText: .init(stringValue: ""),
|
||||
filtered: [],
|
||||
sensitive: false,
|
||||
language: language)
|
||||
}
|
||||
|
||||
|
||||
public static func placeholders() -> [Status] {
|
||||
[.placeholder(), .placeholder(), .placeholder(), .placeholder(), .placeholder()]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue