diff --git a/packages/experience/src/assets/icons/expandable-icon.svg b/packages/experience/src/assets/icons/expandable-icon.svg index 3d0c8a91e..5cecadfeb 100644 --- a/packages/experience/src/assets/icons/expandable-icon.svg +++ b/packages/experience/src/assets/icons/expandable-icon.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationItem/index.module.scss b/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationItem/index.module.scss index 8833f8dc5..99c3b640b 100644 --- a/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationItem/index.module.scss +++ b/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationItem/index.module.scss @@ -1,8 +1,9 @@ @use '@/scss/underscore' as _; .organizationItem { - @include _.flex-row; - padding: _.unit(2) _.unit(4); + border-radius: _.unit(2); + padding: _.unit(2.5) _.unit(2); + cursor: pointer; .icon { width: 20px; @@ -16,12 +17,8 @@ flex: 1; } - &[role='button'] { - cursor: pointer; - - &:hover { - background-color: var(--color-overlay-brand-hover); - } + &:hover { + background-color: var(--color-overlay-neutral-hover); } &[data-selected='true'] { @@ -31,4 +28,5 @@ color: var(--color-brand-default); } } + @include _.flex-row; } diff --git a/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationItem/index.tsx b/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationItem/index.tsx index 46c10a48f..82c026139 100644 --- a/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationItem/index.tsx +++ b/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationItem/index.tsx @@ -1,4 +1,5 @@ import { type ConsentInfoResponse } from '@logto/schemas'; +import classNames from 'classnames'; import { type ReactNode } from 'react'; import CheckMark from '@/assets/icons/check-mark.svg'; @@ -10,6 +11,7 @@ import * as styles from './index.module.scss'; export type Organization = Exclude[number]; type OrganizationItemProps = { + className?: string; organization: Organization; onSelect?: (organization: Organization) => void; isSelected?: boolean; @@ -21,10 +23,11 @@ const OrganizationItem = ({ onSelect, isSelected, suffixElement, + className, }: OrganizationItemProps) => { return (
{ onSelect(organization); }, - onKeyDown: () => { - onKeyDownHandler({ - Enter: () => { - onSelect(organization); - }, - ' ': () => { - onSelect(organization); - }, - }); - }, + onKeyDown: onKeyDownHandler(() => { + onSelect(organization); + }), })} > {isSelected ? ( diff --git a/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationSelectorModal/index.module.scss b/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationSelectorModal/index.module.scss index afb5b8d3f..f2767f05f 100644 --- a/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationSelectorModal/index.module.scss +++ b/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationSelectorModal/index.module.scss @@ -11,10 +11,13 @@ border: _.border(var(--color-line-divider)); box-shadow: var(--color-shadow-2); border-radius: _.unit(2); - background-color: var(--color-bg-float); + background: var(--color-bg-float); position: absolute; z-index: 50; - padding: _.unit(2) 0; + + .container { + padding: _.unit(2); + } } :global(body.mobile) { @@ -31,8 +34,16 @@ border-bottom-right-radius: 0; bottom: 0; width: 100%; - height: 300px; - padding: _.unit(4) 0; + min-height: 200px; + padding-bottom: env(safe-area-inset-bottom); + + .container { + padding: _.unit(3) _.unit(1); + } + } + + .organizationItem { + padding: _.unit(3); } } diff --git a/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationSelectorModal/index.tsx b/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationSelectorModal/index.tsx index ed7d5705e..9af510998 100644 --- a/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationSelectorModal/index.tsx +++ b/packages/experience/src/pages/Consent/OrganizationSelector/OrganizationSelectorModal/index.tsx @@ -65,17 +65,20 @@ const OrganizationSelectorModal = ({ closeTimeoutMS={isMobile ? 300 : 0} onRequestClose={onClose} > - {organizations.map((organization) => ( - { - onClose(); - onSelect(organization); - }} - /> - ))} +
+ {organizations.map((organization) => ( + { + onClose(); + onSelect(organization); + }} + /> + ))} +
); }; diff --git a/packages/experience/src/pages/Consent/OrganizationSelector/index.module.scss b/packages/experience/src/pages/Consent/OrganizationSelector/index.module.scss index cfcf1ed67..42e19c517 100644 --- a/packages/experience/src/pages/Consent/OrganizationSelector/index.module.scss +++ b/packages/experience/src/pages/Consent/OrganizationSelector/index.module.scss @@ -8,28 +8,25 @@ .cardWrapper { border: _.border(var(--color-line-divider)); border-radius: 8px; - padding: _.unit(2) 0; + padding: _.unit(2); position: relative; + + &[data-active='true'] { + border-color: var(--color-brand-default); + outline: 3px solid var(--color-overlay-brand-focused); + } } .expandButton { position: relative; + width: 20px; + height: 20px; + color: var(--color-type-disable); +} - // increase the clickable area - &::after { - content: ''; - display: block; - position: absolute; - top: -10px; - left: -10px; - width: 40px; - height: 40px; - } - - svg { - width: 20px; - height: 20px; - color: var(--color-type-secondary); +.selectedOrganization { + &:hover { + background: none; } } diff --git a/packages/experience/src/pages/Consent/OrganizationSelector/index.tsx b/packages/experience/src/pages/Consent/OrganizationSelector/index.tsx index f6b870d22..027e4eac8 100644 --- a/packages/experience/src/pages/Consent/OrganizationSelector/index.tsx +++ b/packages/experience/src/pages/Consent/OrganizationSelector/index.tsx @@ -2,7 +2,6 @@ import { useState, useRef } from 'react'; import { useTranslation } from 'react-i18next'; import ExpandableIcon from '@/assets/icons/expandable-icon.svg'; -import IconButton from '@/components/Button/IconButton'; import OrganizationItem, { type Organization } from './OrganizationItem'; import OrganizationSelectorModal from './OrganizationSelectorModal'; @@ -33,19 +32,14 @@ const OrganizationSelector = ({ return (
{t('description.grant_organization_access')}
-
+
{ - setShowDropdown(true); - }} - > - - - } + suffixElement={} + onSelect={() => { + setShowDropdown(true); + }} />
{groupName}
- - - +
{expanded && (