fix: opravy zobrazeni sekce vybranych jidel #47

Merged
mates merged 1 commits from feat/redesign into master 2026-02-05 10:19:28 +01:00
2 changed files with 96 additions and 69 deletions
Showing only changes of commit f13cd4ffa9 - Show all commits

View File

@@ -628,56 +628,77 @@ input[type="text"], input[type="email"], input[type="password"] {
tbody tr { tbody tr {
transition: var(--luncher-transition); transition: var(--luncher-transition);
border-bottom: 1px solid var(--luncher-border-light);
&:hover { &:hover {
background: var(--luncher-bg-hover); background: var(--luncher-bg-hover);
} }
&:last-child td { &:last-child {
border-bottom: none; border-bottom: none;
td {
border-bottom: none;
}
} }
} }
td { td {
padding: 12px 16px; padding: 12px 16px;
border-color: var(--luncher-border-light); border: none;
color: var(--luncher-text); color: var(--luncher-text);
white-space: nowrap;
vertical-align: middle; vertical-align: middle;
} }
.user-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
} }
ul { .user-info {
padding: 0; display: flex;
margin: 8px 0 0 20px; align-items: center;
gap: 8px;
flex-wrap: wrap;
}
li { .user-actions {
color: var(--luncher-text-secondary); display: flex;
font-size: 0.9rem; gap: 8px;
margin-bottom: 4px; align-items: center;
white-space: nowrap;
} }
} }
.food-choices { .food-choices {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 6px; gap: 4px;
margin-top: 8px;
} }
.food-choice-item { .food-choice-item {
background: var(--luncher-primary-light); display: inline-flex;
padding: 8px 12px;
border-radius: var(--luncher-radius-sm);
display: flex;
align-items: center; align-items: center;
justify-content: space-between; gap: 6px;
font-size: 0.9rem; font-size: 0.85rem;
border-left: 3px solid var(--luncher-primary); color: var(--luncher-text-secondary);
.action-icon {
opacity: 0;
transition: var(--luncher-transition);
}
&:hover .action-icon {
opacity: 1;
}
} }
.food-choice-name { .food-choice-name {
color: var(--luncher-text); color: var(--luncher-text-secondary);
font-weight: 500; font-weight: 400;
} }
} }

View File

@@ -544,12 +544,16 @@ function App() {
const isBuyer = userPayload?.isBuyer || false; const isBuyer = userPayload?.isBuyer || false;
return <tr key={entry[0]}> return <tr key={entry[0]}>
<td> <td>
<div className="user-row">
<div className="user-info">
{trusted && <span className='trusted-icon' title='Uživatel ověřený doménovým přihlášením'> {trusted && <span className='trusted-icon' title='Uživatel ověřený doménovým přihlášením'>
<FontAwesomeIcon icon={faCircleCheck} style={{ cursor: "help" }} /> <FontAwesomeIcon icon={faCircleCheck} style={{ cursor: "help" }} />
</span>} </span>}
<strong>{login}</strong> <strong>{login}</strong>
{userPayload.departureTime && <small className="ms-2" style={{ color: 'var(--luncher-text-muted)' }}>({userPayload.departureTime})</small>} {userPayload.departureTime && <small className="ms-2" style={{ color: 'var(--luncher-text-muted)' }}>({userPayload.departureTime})</small>}
{userPayload.note && <span className="ms-2" style={{ fontSize: 'small', color: 'var(--luncher-text-secondary)' }}>({userPayload.note})</span>} {userPayload.note && <span className="ms-2" style={{ fontSize: 'small', color: 'var(--luncher-text-secondary)' }}>({userPayload.note})</span>}
</div>
<div className="user-actions">
{login === auth.login && canChangeChoice && locationKey === LunchChoice.OBJEDNAVAM && <span title='Označit/odznačit se jako objednávající'> {login === auth.login && canChangeChoice && locationKey === LunchChoice.OBJEDNAVAM && <span title='Označit/odznačit se jako objednávající'>
<FontAwesomeIcon onClick={() => { <FontAwesomeIcon onClick={() => {
markAsBuyer(); markAsBuyer();
@@ -575,10 +579,11 @@ function App() {
doRemoveChoices(key as LunchChoice); doRemoveChoices(key as LunchChoice);
}} className='action-icon' icon={faTrashCan} /> }} className='action-icon' icon={faTrashCan} />
</span>} </span>}
</td> </div>
{userChoices?.length && food ? <td> </div>
{userChoices && userChoices.length > 0 && food && (
<div className="food-choices"> <div className="food-choices">
{userChoices?.map(foodIndex => { {userChoices.map(foodIndex => {
const restaurantKey = key as Restaurant; const restaurantKey = key as Restaurant;
const foodName = food[restaurantKey]?.food?.[foodIndex].name; const foodName = food[restaurantKey]?.food?.[foodIndex].name;
return <div key={foodIndex} className="food-choice-item"> return <div key={foodIndex} className="food-choice-item">
@@ -592,7 +597,8 @@ function App() {
</div> </div>
})} })}
</div> </div>
</td> : null} )}
</td>
</tr> </tr>
} }
)} )}