Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(DefinitionList): add mobile view #205

Merged
merged 2 commits into from
Jul 10, 2024
Merged

Conversation

Raubzeug
Copy link
Contributor

@Raubzeug Raubzeug commented Jul 3, 2024

closes #184

@Raubzeug Raubzeug requested a review from amje July 3, 2024 09:41
@gravity-ui-bot
Copy link
Contributor

Preview is ready.


const normalizedItems = React.useMemo(() => {
return getFlattenItems(items).map((value, index) => ({...value, key: index}));
}, [items]);

return (
<dl className={b({responsive}, className)} data-qa={qa}>
<dl className={b({responsive: responsive, vertical}, className)} data-qa={qa}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be a shorthand while name is the same


import './DefinitionList.scss';

export function DefinitionList({
items,
responsive,
vertical,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually call it direction with horizontal and vertical values

Comment on lines +137 to +140
margin-block-start: var(--g-spacing-8);
}
#{$block}__item:is(#{$block}__item_grouped) + #{$block}__item:not(#{$block}__item_grouped) {
margin-block-start: var(--g-spacing-8);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These margins looks too big imo. Have been they approved by design team?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Designers have been approved this.

Comment on lines 10 to 13
| responsive | `boolean` | | | If set to `true` list will take 100% width of its parent |
| vertical | `boolean` | | | If set to `true` content will be located under name |
| nameMaxWidth | `number` | | | Maximum width of term |
| contentMaxWidth | `number \| 'auto'` | | 'auto' | Maximum width of definition |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should note that responsive, nameMaxWidth and contentMaxWidth no longer work if vertical is set

Copy link
Contributor Author

@Raubzeug Raubzeug Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Raubzeug Raubzeug merged commit b94ee82 into main Jul 10, 2024
3 checks passed
@Raubzeug Raubzeug deleted the definition-list-mobile branch July 10, 2024 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat(DefinitionList): mobile support
3 participants