First version

This commit is contained in:
Christoph Hagen
2024-10-14 19:22:32 +02:00
parent 7c812de089
commit 0989f06d87
51 changed files with 2477 additions and 234 deletions

View File

@ -0,0 +1,19 @@
import SwiftUI
/// An image loaded from the app resources for test purposes
struct MockImage {
let name: String
static var images: [ImageResource] {
["image1", "image2", "image3", "image4"]
.map(ImageResource.init)
}
}
extension MockImage: ExpressibleByStringLiteral {
init(stringLiteral value: StringLiteralType) {
self.name = value
}
}

View File

@ -0,0 +1,18 @@
import Foundation
extension Page {
static var empty: Page {
.init(
id: "my-id",
isDraft: true,
metadata: [
.init(language: .english, headline: "Title"),
.init(language: .german, headline: "Titel")
],
externalFiles: [],
requiredFiles: [],
images: [])
}
}

View File

@ -0,0 +1,53 @@
extension Post {
static var empty: Post {
.init(id: 0,
isDraft: true,
startDate: .now,
title: .init(en: "The title", de: "Der Titel"),
text: .init(en: "", de: ""),
tags: [],
images: [])
}
static var mock: Post {
Post(
id: 1,
isDraft: false,
startDate: .now,
endDate: nil,
title: .init(en: "The title", de: "Der Titel"),
text: .init(
en: "Very nice and solitary hike from Oberau to Krottenkopf. Challenging and rewarding, due to the length and height.",
de: "Sehr schöne und einsame Tour von Oberau zum Krottenkopf. Abwechslungsreich und stellenweise fordernd, aufgrund der Länge und der Höhenmeter auch anstrengend."
),
tags: [
Tag(en: "Nature", de: "Natur"),
Tag(en: "Sports", de: "Sport"),
Tag(en: "Hiking", de: "Wandern")
],
images: []
)
}
static var fullMock: Post {
.init(
id: 2,
isDraft: true,
startDate: .now.addingTimeInterval(-86400), endDate: .now,
title: .init(en: "A longer title", de: "Ein langer Titel"),
text: .init(
en: "Very nice and solitary hike from Oberau to Krottenkopf. Challenging and rewarding, due to the length and height.",
de: "Sehr schöne und einsame Tour von Oberau zum Krottenkopf. Abwechslungsreich und stellenweise fordernd, aufgrund der Länge und der Höhenmeter auch anstrengend."
),
tags: [
Tag(en: "Nature", de: "Natur"),
Tag(en: "Sports", de: "Sport"),
Tag(en: "Hiking", de: "Wandern"),
Tag(en: "Mountains", de: "Berge")
],
images: MockImage.images
)
}
}

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "image1.jpg",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 MiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "image2.jpg",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "image3.jpg",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "image4.jpg",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB