Skip to content

Commit

Permalink
fix(SimpleCell): fix before icon offset (iOS) (#6829)
Browse files Browse the repository at this point in the history
* fix(SimpleCell): fix before icon offset (iOS)

* CHORE: Update screenshots

---------

Co-authored-by: GitHub Action <actions@github.com>
  • Loading branch information
BlackySoul and actions-user committed Apr 22, 2024
1 parent 51de7ba commit 957c65e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ export const SimpleCellPlayground = (props: ComponentPlaygroundProps) => {
],
indicator: ['1:20:22'],
},
{
before: [<Icon28MessageOutline key="icon" />],
children: ['Title'],
},
]}
>
{(props: SimpleCellProps) => <SimpleCell {...props} />}
Expand Down
5 changes: 5 additions & 0 deletions packages/vkui/src/components/SimpleCell/SimpleCell.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
padding-inline-end: 4px;
}

/* stylelint-disable-next-line selector-pseudo-class-disallowed-list */
.SimpleCell__before--ios > :global(.vkuiIcon) {
padding-inline-end: 0;
}

.SimpleCell__before:empty {
display: none;
}
Expand Down
9 changes: 8 additions & 1 deletion packages/vkui/src/components/SimpleCell/SimpleCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,14 @@ export const SimpleCell = ({
className,
)}
>
<div className={styles['SimpleCell__before']}>{before}</div>
<div
className={classNames(
styles['SimpleCell__before'],
platform === 'ios' && styles['SimpleCell__before--ios'],
)}
>
{before}
</div>
<div className={styles['SimpleCell__middle']}>
{subhead && (
<Subhead
Expand Down

0 comments on commit 957c65e

Please sign in to comment.