Skip to content

Commit

Permalink
Editor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimillian committed Jan 8, 2024
1 parent 556eb15 commit 14b2583
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions Packages/StatusKit/Sources/StatusKit/Editor/EditorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,33 +157,31 @@ extension StatusEditor {
private var characterCountAndLangView: some View {
let value = (currentInstance.instance?.configuration?.statuses.maxCharacters ?? 500) + viewModel.statusTextCharacterLength
HStack(alignment: .center) {
if editorFocusState == assignedFocusState {
LangButton(viewModel: viewModel)
.padding(.leading, .layoutPadding)

Button {
withAnimation {
viewModel.showPoll.toggle()
viewModel.resetPollDefaults()
}
} label: {
Image(systemName: viewModel.showPoll ? "chart.bar.fill" : "chart.bar")
LangButton(viewModel: viewModel)
.padding(.leading, .layoutPadding)

Button {
withAnimation {
viewModel.showPoll.toggle()
viewModel.resetPollDefaults()
}
.buttonStyle(.bordered)
.accessibilityLabel("accessibility.editor.button.poll")
.disabled(viewModel.shouldDisablePollButton)
} label: {
Image(systemName: viewModel.showPoll ? "chart.bar.fill" : "chart.bar")
}
.buttonStyle(.bordered)
.accessibilityLabel("accessibility.editor.button.poll")
.disabled(viewModel.shouldDisablePollButton)

Button {
withAnimation {
viewModel.spoilerOn.toggle()
}
isSpoilerTextFocused = viewModel.id
} label: {
Image(systemName: viewModel.spoilerOn ? "exclamationmark.triangle.fill" : "exclamationmark.triangle")
Button {
withAnimation {
viewModel.spoilerOn.toggle()
}
.buttonStyle(.bordered)
.accessibilityLabel("accessibility.editor.button.spoiler")
isSpoilerTextFocused = viewModel.id
} label: {
Image(systemName: viewModel.spoilerOn ? "exclamationmark.triangle.fill" : "exclamationmark.triangle")
}
.buttonStyle(.bordered)
.accessibilityLabel("accessibility.editor.button.spoiler")

Spacer()

Expand Down

0 comments on commit 14b2583

Please sign in to comment.