Skip to content

Commit

Permalink
chore(new-ui): tweak attempt picker design
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowusr committed Sep 28, 2024
1 parent 9d961f5 commit f714354
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 10 deletions.
1 change: 1 addition & 0 deletions lib/static/new-ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
.g-root {
--g-font-family-sans: 'Jost', sans-serif;
--g-color-base-background: #eee;
--g-color-text-danger-heavy: #e9043a;
}

body {
Expand Down
14 changes: 14 additions & 0 deletions lib/static/new-ui/components/AttemptPicker/index.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.container {
display: flex;
gap: 16px;
}

.heading {
line-height: 28px;
}

.attempts-container {
display: flex;
flex-wrap: wrap;
gap: 4px;
}
13 changes: 7 additions & 6 deletions lib/static/new-ui/components/AttemptPicker/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {Flex} from '@gravity-ui/uikit';
import React, {ReactNode} from 'react';
import {connect} from 'react-redux';

import {State} from '@/static/new-ui/types/store';
import {AttemptPickerItem} from '@/static/new-ui/components/AttemptPickerItem';
import styles from './index.module.css';
import classNames from 'classnames';

interface AttemptPickerProps {
onChange?: (browserId: string, resultId: string, attemptIndex: number) => unknown;
Expand All @@ -26,9 +27,9 @@ function AttemptPickerInternal(props: AttemptPickerInternalProps): ReactNode {
props.onChange?.(props.browserId, resultId, attemptIndex);
};

return <Flex alignItems={'center'} gap={5}>
<h3 className='text-header-1'>Attempts</h3>
<Flex gap={0.5} wrap={'wrap'}>
return <div className={styles.container}>
<h3 className={classNames('text-header-1', styles.heading)}>Attempts</h3>
<div className={styles.attemptsContainer}>
{resultIds.map((resultId, index) => {
const isActive = resultId === currentResultId;

Expand All @@ -39,8 +40,8 @@ function AttemptPickerInternal(props: AttemptPickerInternalProps): ReactNode {
onClick={(): unknown => onClickHandler(resultId, index)}
/>;
})}
</Flex>
</Flex>;
</div>
</div>;
}

export const AttemptPicker = connect((state: State) => {
Expand Down
14 changes: 13 additions & 1 deletion lib/static/new-ui/components/AttemptPickerItem/index.module.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
.attempt-picker-item {
--g-button-padding: 8px;
width: 28px;
}

.attempt-picker-item--active {
--g-button-border-width: 1px;
box-shadow: 0px 1px 3px 0px var(--box-shadow-color);
}

.attempt-picker-item--staged {
Expand All @@ -16,10 +17,21 @@
border-color: rgba(207, 231, 252, 1);
}

.attempt-picker-item--success {
--box-shadow-color: #21a95661;
}

.attempt-picker-item--error {
--box-shadow-color: #ff004b61;
}

.attempt-picker-item--fail {
--g-button-text-color-hover: #c522ff;
--g-button-background-color-hover: #cf49ff4f;
--g-button-background-color: var(--color-pink-100);
--g-button-text-color: var(--color-pink-600);
--g-button-border-color: var(--color-pink-600);
--box-shadow-color: #cf49ff61;
}

.attempt-picker-item--fail_error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
position: sticky;
top: 0;
z-index: 10;
padding-bottom: 4px;
padding-bottom: 8px;
border-bottom: 1px solid #eee;
}
4 changes: 2 additions & 2 deletions lib/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -949,8 +949,8 @@ a:active {

.text-header-1 {
font-family: Jost, sans-serif;
font-weight: 500;
font-size: var(--g-text-header-1-font-size);
font-weight: 450;
font-size: 18px;
line-height: var(--g-text-header-1-line-height);
margin: 0;
}
Expand Down

0 comments on commit f714354

Please sign in to comment.