fix: share-residence import preview polish (closes #7) #9
@@ -288,8 +288,14 @@ class PreviewViewController: UIViewController, QLPreviewingController {
|
|||||||
let expiredAgo = Self.expiredRelativePhraseOrNil(residence.expiresAt)
|
let expiredAgo = Self.expiredRelativePhraseOrNil(residence.expiresAt)
|
||||||
if let expiredAgo {
|
if let expiredAgo {
|
||||||
instructionLabel.attributedText = Self.makeExpiredInstructions(sharedBy: residence.sharedBy)
|
instructionLabel.attributedText = Self.makeExpiredInstructions(sharedBy: residence.sharedBy)
|
||||||
|
// The down-chevron points at the Share button as a visual
|
||||||
|
// cue to tap it; in the expired state there's nothing
|
||||||
|
// useful to share (the server will reject the bundled
|
||||||
|
// code) so the arrow becomes misleading. Hide it.
|
||||||
|
arrowImageView.isHidden = true
|
||||||
} else {
|
} else {
|
||||||
instructionLabel.attributedText = Self.makeResidenceInstructions()
|
instructionLabel.attributedText = Self.makeResidenceInstructions()
|
||||||
|
arrowImageView.isHidden = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear existing details
|
// Clear existing details
|
||||||
|
|||||||
@@ -277,11 +277,15 @@ private final class MockPreviewViewController: UIViewController {
|
|||||||
switch state {
|
switch state {
|
||||||
case .active:
|
case .active:
|
||||||
instructionLabel.attributedText = makeResidenceInstructions()
|
instructionLabel.attributedText = makeResidenceInstructions()
|
||||||
|
arrowImageView.isHidden = false
|
||||||
if let expiresAt = residence.expiresAt, !expiresAt.isEmpty {
|
if let expiresAt = residence.expiresAt, !expiresAt.isEmpty {
|
||||||
addDetailRow(icon: "clock", text: "Expires \(formatActiveExpiry(expiresAt))")
|
addDetailRow(icon: "clock", text: "Expires \(formatActiveExpiry(expiresAt))")
|
||||||
}
|
}
|
||||||
case .expired(let elapsed):
|
case .expired(let elapsed):
|
||||||
instructionLabel.attributedText = makeExpiredInstructions(sharedBy: residence.sharedBy)
|
instructionLabel.attributedText = makeExpiredInstructions(sharedBy: residence.sharedBy)
|
||||||
|
// Arrow points at the Share button — no point telling the
|
||||||
|
// user to tap it for a dead link. Matches PreviewViewController.
|
||||||
|
arrowImageView.isHidden = true
|
||||||
addDetailRow(icon: "clock", text: "Expired \(relativePhrase(secondsAgo: elapsed))")
|
addDetailRow(icon: "clock", text: "Expired \(relativePhrase(secondsAgo: elapsed))")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
Reference in New Issue
Block a user