Skip to content

Commit

Permalink
fix: 🐛 testing feedback, condition fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
koepferd committed Apr 22, 2021
1 parent c0c08c7 commit 5789d60
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/components/groupChat/JoinGroupChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export const JoinGroupChatView = () => {
/>
{groupChatRuleTexts[
getResortKeyForConsultingType(chatItem.consultingType)
].map((groupChatRuleText, i) => (
]?.map((groupChatRuleText, i) => (
<Text text={groupChatRuleText} type="standard" key={i} />
))}
</div>
Expand Down
12 changes: 7 additions & 5 deletions src/components/session/SessionItemComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,14 @@ export const SessionItemComponent = (props: SessionItemProps) => {
}
};

const resortData: ResortData = Object.entries(
registrationResortsData
).filter(
const filteredResortsData = Object.entries(registrationResortsData).filter(
(resort) =>
resort[1].consultingType === chatItem.consultingType?.toString()
)[0][1];
);
let currentResortData: ResortData;
if (filteredResortsData) {
currentResortData = filteredResortsData[0][1];
}

return (
<div
Expand Down Expand Up @@ -279,7 +281,7 @@ export const SessionItemComponent = (props: SessionItemProps) => {
type={getTypeOfLocation()}
isOnlyEnquiry={isOnlyEnquiry}
isMyMessage={isMyMessage(message.userId)}
resortData={resortData}
resortData={currentResortData}
{...message}
/>
))}
Expand Down
3 changes: 2 additions & 1 deletion src/components/session/SessionViewEmpty.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as React from 'react';
import { translate } from '../../resources/scripts/i18n/translate';
import { Text } from '../text/Text';
import './session.styles';

export const SessionViewEmpty = () => {
return (
<div className="session session--empty">
<p>{translate('session.empty')}</p>
<Text text={translate('session.empty')} type="divider" />
</div>
);
};
6 changes: 1 addition & 5 deletions src/components/session/session.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,8 @@ $unreadButtonSize: 18px;
&--empty {
justify-content: center;
align-items: center;
padding-top: 80px !important;
display: none;
p {
padding-top: 10px;
color: $light-grey;
}

@include breakpoint($fromLarge) {
display: flex;
}
Expand Down
30 changes: 16 additions & 14 deletions src/components/sessionsList/sessionsList.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ $headerHeight: 80px;
}
}

&--empty {
margin-top: $grid-base-four;
text-align: center;
}

&__itemsWrapper {
overflow-x: hidden;

Expand Down Expand Up @@ -222,15 +217,22 @@ $headerHeight: 80px;
}
}

.sessionsList__headline {
align-self: center;
font-size: $font-size-h3;
font-weight: $font-weight-medium;
line-height: $line-height-tertiary;
margin-bottom: 0;
margin-right: $grid-base-seven;
.sessionsList {
&__headline {
align-self: center;
font-size: $font-size-h3;
font-weight: $font-weight-medium;
line-height: $line-height-tertiary;
margin-bottom: 0;
margin-right: $grid-base-seven;

@include breakpoint($fromLarge) {
margin-left: 0;
}
}

@include breakpoint($fromLarge) {
margin-left: 0;
&--empty {
margin-top: $grid-base-four;
text-align: center;
}
}

0 comments on commit 5789d60

Please sign in to comment.