Skip to content

Commit

Permalink
feat: modified sheet size and add text color
Browse files Browse the repository at this point in the history
  • Loading branch information
lukacs-m committed May 21, 2024
1 parent 3a8c866 commit 3e14cb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion iOS/Scenes/Homepage/HomepageCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 816,7 @@ extension HomepageCoordinator {
let view = PublicLinkView(viewModel: .init(itemContent: item))
let viewController = UIHostingController(rootView: view)

viewController.setDetentType(.large,
viewController.setDetentType(.medium,
parentViewController: rootViewController)

viewController.sheetPresentationController?.prefersGrabberVisible = true
Expand Down
19 changes: 4 additions & 15 deletions iOS/Scenes/Sharing/PublicLinkView/PublicLinkView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 57,6 @@ private extension PublicLinkView {
.frame(maxWidth: .infinity, maxHeight: .infinity)
.showSpinner(viewModel.loading)
.animation(.default, value: viewModel.link)
.toolbar { toolbarContent }
.scrollViewEmbeded(maxWidth: .infinity)
.background(PassColor.backgroundNorm.toColor)
.navigationBarBackButtonHidden(true)
Expand Down Expand Up @@ -94,6 93,7 @@ private extension PublicLinkView {
VStack(spacing: DesignConstant.sectionPadding) {
HStack {
Text("Link expires after") Text(verbatim: ":")
.foregroundColor(PassColor.textNorm.toColor)

Spacer()
Picker("Link expires after", selection: $viewModel.selectedTime) {
Expand All @@ -103,7 103,7 @@ private extension PublicLinkView {
.foregroundStyle(PassColor.textNorm.toColor)
}
}
.tint(PassColor.interactionNormMajor2.toColor)
.tint(viewModel.itemContent.contentData.type.normMajor2Color.toColor)
}

VStack {
Expand All @@ -112,6 112,7 @@ private extension PublicLinkView {

if viewModel.addNumberOfReads {
TextField("Max number of reads", text: $viewModel.maxNumber)
.foregroundStyle(PassColor.textNorm.toColor)
.keyboardType(.numberPad)
.padding(DesignConstant.sectionPadding)
.roundedDetailSection()
Expand All @@ -134,6 135,7 @@ private extension PublicLinkView {
VStack(spacing: DesignConstant.sectionPadding) {
HStack(spacing: DesignConstant.sectionPadding) {
Text(verbatim: link.url)
.foregroundStyle(PassColor.textNorm.toColor)
.lineLimit(1)
.frame(maxWidth: .infinity, alignment: .leading)
.padding()
Expand Down Expand Up @@ -164,16 166,3 @@ private extension PublicLinkView {
}
}
}

private extension PublicLinkView {
@ToolbarContentBuilder
var toolbarContent: some ToolbarContent {
ToolbarItem(placement: .navigationBarLeading) {
CircleButton(icon: IconProvider.chevronDown,
iconColor: PassColor.interactionNormMajor2,
backgroundColor: PassColor.interactionNormMinor1,
accessibilityLabel: "Close",
action: dismiss.callAsFunction)
}
}
}

0 comments on commit 3e14cb1

Please sign in to comment.