-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Eric Andrews <[email protected]>
- Loading branch information
1 parent
eed8507
commit 1606daf
Showing
51 changed files
with
225 additions
and
97 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
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
14 changes: 14 additions & 0 deletions
14
Mlem/Assets.xcassets/Icons/icon.sjmarf.green.appiconset/Contents.json
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,14 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "green.png", | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions
14
Mlem/Assets.xcassets/Icons/icon.sjmarf.orange.appiconset/Contents.json
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,14 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "orange.png", | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions
14
Mlem/Assets.xcassets/Icons/icon.sjmarf.pink.appiconset/Contents.json
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,14 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "pink.png", | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions
14
Mlem/Assets.xcassets/Icons/icon.sjmarf.silver.appiconset/Contents.json
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,14 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "logo.png", | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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
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,70 @@ | ||
// | ||
// CollapsibleSection.swift | ||
// Mlem | ||
// | ||
// Created by Sjmarf on 02/01/2024. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct CollapsibleSection<Content: View>: View { | ||
var header: String? | ||
var footer: String? | ||
|
||
@ViewBuilder var content: () -> Content | ||
@State private var collapsed: Bool | ||
|
||
init( | ||
_ header: String? = nil, | ||
footer: String? = nil, | ||
collapsed: Bool = false, | ||
@ViewBuilder _ content: @escaping () -> Content | ||
) { | ||
self.header = header | ||
self.footer = footer | ||
self.content = content | ||
self._collapsed = State(wrappedValue: collapsed) | ||
} | ||
|
||
var body: some View { | ||
VStack(alignment: .leading, spacing: 0) { | ||
if let header { | ||
HStack { | ||
Text(header) | ||
.textCase(.uppercase) | ||
.opacity(0.5) | ||
Spacer() | ||
Image(systemName: Icons.dropdown) | ||
.fontWeight(.semibold) | ||
.foregroundStyle(Color.accentColor) | ||
.rotationEffect(Angle(degrees: collapsed ? -90 : 0)) | ||
} | ||
.font(.footnote) | ||
.contentShape(.rect) | ||
.onTapGesture { withAnimation(.default) { collapsed.toggle() }} | ||
.padding(.vertical, 6) | ||
.padding(.horizontal, 16) | ||
} | ||
|
||
if !collapsed { | ||
Color(uiColor: .systemGroupedBackground) | ||
.frame(height: 1.5) | ||
VStack { | ||
content() | ||
} | ||
|
||
if let footer = footer { | ||
Text(footer) | ||
.textCase(.uppercase) | ||
.font(.footnote) | ||
.padding(.horizontal, 16) | ||
.foregroundStyle(.secondary) | ||
} | ||
} | ||
} | ||
.background(Color(uiColor: .secondarySystemGroupedBackground)) | ||
.clipShape(RoundedRectangle(cornerRadius: AppConstants.largeItemCornerRadius)) | ||
.fixedSize(horizontal: false, vertical: true) | ||
.padding(.horizontal, 16) | ||
} | ||
} |
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
Oops, something went wrong.