pointless refactors

This commit is contained in:
William Casarin
2023-04-06 08:27:04 -07:00
parent b532dc48e1
commit 532eaa35bf
2 changed files with 25 additions and 25 deletions

View File

@@ -102,10 +102,10 @@ struct TranslateView: View {
}
}
if let translated = translated_note {
if let translated_note {
// Render translated note.
let translatedBlocks = event.get_blocks(content: translated)
translated_artifacts = render_blocks(blocks: translatedBlocks, profiles: damus_state.profiles, privkey: damus_state.keypair.privkey)
let translated_blocks = event.get_blocks(content: translated_note)
translated_artifacts = render_blocks(blocks: translated_blocks, profiles: damus_state.profiles, privkey: damus_state.keypair.privkey)
}
checkingTranslationStatus = false

View File

@@ -14,28 +14,6 @@ enum EventViewKind {
case selected
}
func eventviewsize_to_font(_ size: EventViewKind) -> Font {
switch size {
case .small:
return .body
case .normal:
return .body
case .selected:
return .custom("selected", size: 21.0)
}
}
func eventviewsize_to_uifont(_ size: EventViewKind) -> UIFont {
switch size {
case .small:
return .preferredFont(forTextStyle: .body)
case .normal:
return .preferredFont(forTextStyle: .body)
case .selected:
return .preferredFont(forTextStyle: .title2)
}
}
struct EventView: View {
let event: NostrEvent
let options: EventViewOptions
@@ -156,6 +134,28 @@ func make_actionbar_model(ev: String, damus: DamusState) -> ActionBarModel {
return model
}
func eventviewsize_to_font(_ size: EventViewKind) -> Font {
switch size {
case .small:
return .body
case .normal:
return .body
case .selected:
return .custom("selected", size: 21.0)
}
}
func eventviewsize_to_uifont(_ size: EventViewKind) -> UIFont {
switch size {
case .small:
return .preferredFont(forTextStyle: .body)
case .normal:
return .preferredFont(forTextStyle: .body)
case .selected:
return .preferredFont(forTextStyle: .title2)
}
}
struct EventView_Previews: PreviewProvider {
static var previews: some View {