Skip to content

Commit

Permalink
fix: review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Binatik committed Nov 26, 2024
1 parent b9f3c1b commit 6cd7de7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ module.exports = {
properties: false
}
}],
// Включено в full файле
'@typescript-eslint/no-unused-vars': 'off'
}
},
Expand Down
1 change: 1 addition & 0 deletions src/misc/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export function isEventWithModifier(event: MouseEvent | KeyboardEvent): boolean
event.metaKey ||
event.altKey ||
event.shiftKey ||
// Нажатие на колесико мыши
(event instanceof MouseEvent && event.button === 1)
)
}
3 changes: 1 addition & 2 deletions src/ui/messenger/ConvoComposer/ConvoComposer.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@
padding-right: 6px;
color: var(--vkui--color_icon_accent);
opacity: 0.8;
transition: 0.2s opacity;
transition: var(--mediumTransition) opacity;
}

.ConvoComposer__send:hover {
color: var(--vkui--color_icon_accent);
opacity: 1;
}

Expand Down
6 changes: 3 additions & 3 deletions src/ui/messenger/ConvoComposer/ConvoComposer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeEvent, computed, defineComponent, KeyboardEvent, ref, shallowRef } from 'vue'
import { ChangeEvent, computed, defineComponent, KeyboardEvent, shallowRef } from 'vue'
import * as Convo from 'model/Convo'
import { useEnv } from 'hooks'
import { isEventWithModifier, random } from 'misc/utils'
Expand All @@ -14,8 +14,8 @@ type Props = {

export const ConvoComposer = defineComponent<Props>((props) => {
const { lang, api } = useEnv()
const loading = ref(false)
const text = ref('')
const loading = shallowRef(false)
const text = shallowRef('')
const $input = shallowRef<HTMLDivElement | null>(null)

const isEmpty = computed(() => text.value.trim() === '')
Expand Down
6 changes: 3 additions & 3 deletions src/ui/messenger/ConvoHistory/ConvoHistory.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { computed, defineComponent, nextTick, onBeforeUnmount, onBeforeUpdate, onMounted, onUpdated, ref, shallowRef } from 'vue'
import { computed, defineComponent, nextTick, onBeforeUnmount, onBeforeUpdate, onMounted, onUpdated, shallowRef } from 'vue'
import * as Convo from 'model/Convo'
import * as History from 'model/History'
import * as Message from 'model/Message'
Expand All @@ -21,7 +21,7 @@ export const ConvoHistory = defineComponent<Props>(({ convo }) => {
const { loadConvoHistoryLock, savedConvoScroll } = useConvosStore()
const historySlice = computed(() => History.around(convo.history, convo.inReadBy))
const $historyElement = shallowRef<HTMLDivElement | null>(null)
const scrollHeight = ref(0)
const scrollHeight = shallowRef(0)

onMounted(() => {
const scrollTop = savedConvoScroll.get(convo.id)
Expand Down Expand Up @@ -60,7 +60,7 @@ export const ConvoHistory = defineComponent<Props>(({ convo }) => {
* Если мы находимся в самом низу, то она будет совпадать с общей высотой, но если
* мы проскроллим вверх, появляется контент под вьюпортом, который нам не виден.
* Тогда сумма не совпадет и мы поймем что юзер не находится внизу
*/
*/
const upperContentHeight = $historyElement.value.scrollTop + $historyElement.value.offsetHeight

if (scrollHeight.value <= upperContentHeight) {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/ui/ButtonIcon/ButtonIcon.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
}

.ButtonIcon[disabled] {
cursor: default;
pointer-events: none;
opacity: 0.6;
transition: var(--mediumTransition) opacity;
}

.ButtonIcon--hoverBackground:hover {
Expand Down
4 changes: 2 additions & 2 deletions src/ui/ui/ButtonIcon/ButtonIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ type Props = {

export const ButtonIcon = defineComponent<Props>((props, { slots }) => {
const { isFocused, onBlur, onFocus } = useFocusVisible()
const { addHoverBackground = true } = props

return () => (
<button
type="button"
class={['ButtonIcon', {
'ButtonIcon--stretched': props.stretched,
'ButtonIcon--hoverBackground': addHoverBackground
'ButtonIcon--hoverBackground': props.addHoverBackground ?? true
}]}
onBlur={onBlur}
onFocus={onFocus}
Expand Down

0 comments on commit 6cd7de7

Please sign in to comment.