Fix hover/focus bg overriding active bg in ConversationList

Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
Jamie Kyle 2023-09-18 14:00:26 -07:00 committed by GitHub
parent d6cc067507
commit 17ea2b58de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 40 deletions

View file

@ -4380,22 +4380,6 @@ button.module-image__border-overlay:focus {
&:disabled {
cursor: inherit;
}
&:hover:not(:disabled),
&:focus:not(:disabled) {
@include light-theme {
background-color: $color-gray-05;
#{$unread-indicator} {
border-color: $color-gray-05;
}
}
@include dark-theme {
background-color: $color-gray-75;
#{$unread-indicator} {
border-color: $color-gray-75;
}
}
}
}
&--is-checkbox {
@ -4404,15 +4388,20 @@ button.module-image__border-overlay:focus {
&--disabled {
cursor: not-allowed;
}
}
$disabled-selector: '#{&}--disabled';
&:hover:not(#{$disabled-selector}),
&:focus:not(#{$disabled-selector}) {
@include light-theme {
background-color: $color-gray-05;
&:hover:not(:disabled, &--disabled, &--is-selected),
&:focus:not(:disabled, &--disabled, &--is-selected) {
@include light-theme {
background-color: $color-gray-05;
#{$unread-indicator} {
border-color: $color-gray-05;
}
@include dark-theme {
background-color: $color-gray-75;
}
@include dark-theme {
background-color: $color-gray-75;
#{$unread-indicator} {
border-color: $color-gray-75;
}
}
}

View file

@ -88,7 +88,9 @@ button.ListTile {
&--clickable {
cursor: pointer;
&:hover:not([aria-disabled='true']) {
&:hover:not([aria-disabled='true'], [aria-selected='true']),
&:focus:not([aria-disabled='true'], [aria-selected='true']) {
@include light-theme {
background-color: $color-black-alpha-06;
}

View file

@ -27,6 +27,7 @@ export type Props = {
// defaults to div
rootElement?: 'div' | 'button';
testId?: string;
'aria-selected'?: boolean;
};
/**
@ -80,6 +81,7 @@ const ListTileImpl = React.forwardRef<HTMLButtonElement, Props>(
variant = 'item',
rootElement = 'div',
testId,
...ariaProps
}: Props,
ref
) {
@ -97,6 +99,7 @@ const ListTileImpl = React.forwardRef<HTMLButtonElement, Props>(
'aria-disabled': disabled ? true : undefined,
onContextMenu,
'data-testid': testId,
...ariaProps,
};
const contents = (

View file

@ -257,7 +257,7 @@ export const BaseConversationListItem: FunctionComponent<PropsType> =
className={classNames(
commonClassNames,
`${BASE_CLASS_NAME}--is-checkbox`,
{ [`${BASE_CLASS_NAME}--is-checkbox--disabled`]: disabled }
{ [`${BASE_CLASS_NAME}--disabled`]: disabled }
)}
data-id={identifier}
data-testid={testId}

View file

@ -12,7 +12,8 @@ import * as durations from '../util/durations';
import { BackOff } from '../util/BackOff';
import { sleep } from '../util/sleep';
import { toDayMillis } from '../util/timestamp';
import { toAciObject, toPniObject, toTaggedPni } from '../types/ServiceId';
import { toTaggedPni } from '../types/ServiceId';
import { toPniObject, toAciObject } from '../util/ServiceId';
import * as log from '../logging/log';
export const GROUP_CREDENTIALS_KEY = 'groupCredentials';

View file

@ -3,7 +3,7 @@
import { v4 as generateUuid } from 'uuid';
import { z } from 'zod';
import { Aci, Pni, ServiceId } from '@signalapp/libsignal-client';
import type { ServiceId, Aci, Pni } from '@signalapp/libsignal-client';
import { isValidUuid } from '../util/isValidUuid';
import * as log from '../logging/log';
@ -166,18 +166,6 @@ export const serviceIdSchema = z
return x;
});
export function toServiceIdObject(serviceId: ServiceIdString): ServiceId {
return ServiceId.parseFromServiceIdString(serviceId);
}
export function toAciObject(aci: AciString): Aci {
return Aci.parseFromServiceIdString(aci);
}
export function toPniObject(pni: PniString): Pni {
return Pni.parseFromServiceIdString(pni);
}
// Note: getServiceIdString() returns normalized string so we can cast it
// without normalizing.
export function fromServiceIdObject(obj: ServiceId): ServiceIdString {

17
ts/util/ServiceId.ts Normal file
View file

@ -0,0 +1,17 @@
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { Aci, Pni, ServiceId } from '@signalapp/libsignal-client';
import type { AciString, PniString, ServiceIdString } from '../types/ServiceId';
export function toServiceIdObject(serviceId: ServiceIdString): ServiceId {
return ServiceId.parseFromServiceIdString(serviceId);
}
export function toAciObject(aci: AciString): Aci {
return Aci.parseFromServiceIdString(aci);
}
export function toPniObject(pni: PniString): Pni {
return Pni.parseFromServiceIdString(pni);
}

View file

@ -21,11 +21,11 @@ import {
import { Aci, Pni, type ServiceId } from '@signalapp/libsignal-client';
import type { ServiceIdString, AciString, PniString } from '../types/ServiceId';
import {
toServiceIdObject,
fromServiceIdObject,
fromAciObject,
fromPniObject,
} from '../types/ServiceId';
import { toServiceIdObject } from './ServiceId';
import { strictAssert } from './assert';
export * from '@signalapp/libsignal-client/zkgroup';