Skip to content

Refactor Thanks page to use a standard navigation bar#2854

Merged
amy-at-kickstarter merged 3 commits into
mainfrom
feat/adyer/thanks-page-close-button
May 14, 2026
Merged

Refactor Thanks page to use a standard navigation bar#2854
amy-at-kickstarter merged 3 commits into
mainfrom
feat/adyer/thanks-page-close-button

Conversation

@amy-at-kickstarter

@amy-at-kickstarter amy-at-kickstarter commented May 12, 2026

Copy link
Copy Markdown
Contributor

📲 What

Refactor the Thanks page so that it uses the standard navigation bar, instead of hiding the bar and using custom code that looks like a navigation bar.

  1. Replace custom CloseButtonView on Thanks page with a standard UIBarButtonItem
  2. Remove the close button and its container from Thanks.storyboard
  3. Instead of hiding the navigation bar on the Thanks page, set its appearance to a background white

🤔 Why

I'm adding an experiment that changes how we present pages in the Checkout flow. Instead of presenting the checkout flow modally, it will be pushed into the navigation stack with the Project page.

Originally, the Thanks page hides the navigation bar to show its own custom close button on the top left. However, in the new flow, we'll need to pop you back to the Project page - and we'll need the navigation bar back.

I could add more code to hide/show the navigation bar to deal with this case... but it made more sense to me to clean up this custom implementation instead. I refactored the Thanks page to remove the nav bar hiding/showing, and to just use a standard UIBarButtonItem and navigation bar appearance configuration.

Conveniently, this also let me delete a file we no longer need.

👀 Screenshots

iOS 18 iPhone

Before After
thanks-before-ios-18 thanks-after-ios-18

iOS 26 iPhone

Before After
thanks-before-ios-26 thanks-after-ios-26

iPad (iOS 18)

thanks-ipad-after-18

iPad (iOS 26)

thanks-ipad-after

import Library
import UIKit

/// A UIKit close button with liquid glass effect using iOS 26+ native APIs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class existed to add Liquid Glass styling to our custom close button. But with no custom close button, we get liquid glass styling for free 😎


if let navigationController = self.navigationController {
_ = navigationController
|> UINavigationController.lens.isNavigationBarHidden .~ true

@amy-at-kickstarter amy-at-kickstarter May 13, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of hiding the navigation bar, I just make it an opaque white so it blends in. This makes it look essentially the same as it was before (including while scrolling).

@amy-at-kickstarter amy-at-kickstarter force-pushed the feat/adyer/thanks-page-close-button branch from 86152d1 to 3ae45ea Compare May 13, 2026 14:08
@amy-at-kickstarter amy-at-kickstarter force-pushed the feat/adyer/thanks-page-close-button branch from aa6ace2 to de0ed51 Compare May 13, 2026 14:42
@amy-at-kickstarter amy-at-kickstarter changed the title Refactor Thanks page to use a UIBarButtonItem instead of a custom close button Refactor Thanks page to use a standard navigation bar May 13, 2026
@amy-at-kickstarter amy-at-kickstarter marked this pull request as ready for review May 13, 2026 17:50
@amy-at-kickstarter amy-at-kickstarter requested review from a team and scottkicks and removed request for a team May 13, 2026 17:50
</constraints>
</view>
</tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="I5Z-r3-uNR" userLabel="Close button container">

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the close button view we don't need any more.

<constraints>
<constraint firstItem="WMM-y8-QSH" firstAttribute="bottom" secondItem="K36-s7-mGm" secondAttribute="bottom" constant="12" id="0N8-cc-Ig3"/>
<constraint firstItem="K36-s7-mGm" firstAttribute="top" secondItem="I5Z-r3-uNR" secondAttribute="bottom" constant="8" id="T7f-bX-4fo"/>
<constraint firstItem="K36-s7-mGm" firstAttribute="top" secondItem="WMM-y8-QSH" secondAttribute="top" constant="8" id="T7f-bX-4fo"/>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to read, but this is the constraint that used to pin the table view to the bottom of the close button. Now it's pinned to the safe area insets.

@scottkicks scottkicks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@amy-at-kickstarter amy-at-kickstarter merged commit 4b7e568 into main May 14, 2026
7 checks passed
@amy-at-kickstarter amy-at-kickstarter deleted the feat/adyer/thanks-page-close-button branch May 14, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants