Skip to content

Commit

Permalink
style(removed-feedback-features): prettier fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
koepferd committed Jul 25, 2024
1 parent 65fccb2 commit 2e6e119
Show file tree
Hide file tree
Showing 27 changed files with 412 additions and 411 deletions.
27 changes: 15 additions & 12 deletions src/api/apiGetConsultantSessionList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,23 @@ export const apiGetConsultantSessionList = async ({
const isTeamSession: boolean = type === SESSION_LIST_TYPES.TEAMSESSION;
let url: string;
if (isTeamSession) {
url = `${sessionListTab === SESSION_LIST_TAB_ARCHIVE
? `${endpoints.teamSessionsBase}${SESSION_LIST_TAB_ARCHIVE}?`
: `${endpoints.consultantTeamSessions}`
}`;
url = `${
sessionListTab === SESSION_LIST_TAB_ARCHIVE
? `${endpoints.teamSessionsBase}${SESSION_LIST_TAB_ARCHIVE}?`
: `${endpoints.consultantTeamSessions}`
}`;
} else if (type === SESSION_LIST_TYPES.MY_SESSION) {
url = `${sessionListTab === SESSION_LIST_TAB_ARCHIVE
? `${endpoints.myMessagesBase}${SESSION_LIST_TAB_ARCHIVE}?`
: `${endpoints.consultantSessions}`
}`;
url = `${
sessionListTab === SESSION_LIST_TAB_ARCHIVE
? `${endpoints.myMessagesBase}${SESSION_LIST_TAB_ARCHIVE}?`
: `${endpoints.consultantSessions}`
}`;
} else {
url = `${endpoints.consultantEnquiriesBase}${sessionListTab && sessionListTab === SESSION_LIST_TAB_ANONYMOUS
? `${SESSION_LIST_TAB_ANONYMOUS}`
: 'registered'
}?`;
url = `${endpoints.consultantEnquiriesBase}${
sessionListTab && sessionListTab === SESSION_LIST_TAB_ANONYMOUS
? `${SESSION_LIST_TAB_ANONYMOUS}`
: 'registered'
}?`;
}
url = url + `count=${count}&filter=all&offset=${offset}`;

Expand Down
8 changes: 3 additions & 5 deletions src/components/askerInfo/AskerInfoContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ export const AskerInfoContent = () => {
}

if (isEnquiryListView) {
return (
hasUserAuthority(
AUTHORITIES.ASSIGN_CONSULTANT_TO_ENQUIRY,
userData
)
return hasUserAuthority(
AUTHORITIES.ASSIGN_CONSULTANT_TO_ENQUIRY,
userData
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/devToolbar/DevToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const LOCAL_STORAGE_SWITCHES: (TLocalStorageSwitches | null)[] = [
i18n.changeLanguage(
value === 'cimode'
? 'cimode'
: localStorage.getItem(STORAGE_KEY_LOCALE) ?? 'de'
: (localStorage.getItem(STORAGE_KEY_LOCALE) ?? 'de')
);
}
},
Expand Down
8 changes: 4 additions & 4 deletions src/components/form/textarea.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
color: transparent;
}

&:focus+label,
&:not(:placeholder-shown)+label {
&:focus + label,
&:not(:placeholder-shown) + label {
font-size: 12px;
top: 2px;
transition:
Expand All @@ -60,7 +60,7 @@
padding-top: $grid-base;
}

&:placeholder-shown+label {
&:placeholder-shown + label {
top: 4px;
}
}
Expand All @@ -79,4 +79,4 @@
}

/* stylelint-enable */
}
}
4 changes: 2 additions & 2 deletions src/components/message/MessageDisplayName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export const MessageDisplayName = ({
} else {
return subscriberIsModerator
? translate('session.groupChat.consultant.prefix') +
(displayName || username)
(displayName || username)
: translate('session.consultant.prefix') +
(displayName || username);
(displayName || username);
}
}, [
displayName,
Expand Down
25 changes: 15 additions & 10 deletions src/components/message/MessageItemComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ export const MessageItemComponent = ({
setRenderedMessage(
contentStateMessage.hasText()
? sanitizeHtml(
urlifyLinksInText(stateToHTML(contentStateMessage)),
sanitizeHtmlDefaultOptions
)
urlifyLinksInText(stateToHTML(contentStateMessage)),
sanitizeHtmlDefaultOptions
)
: ''
);
}, [decryptedMessage]);
Expand Down Expand Up @@ -464,7 +464,9 @@ export const MessageItemComponent = ({

<div
className={
isMyMessage ? `messageItem__message messageItem__message--myMessage` : `messageItem__message`
isMyMessage
? `messageItem__message messageItem__message--myMessage`
: `messageItem__message`
}
>
<span
Expand Down Expand Up @@ -503,20 +505,23 @@ export const MessageItemComponent = ({

return (
<div
className={`messageItem ${isMyMessage ? 'messageItem--right' : ''
} ${isFullWidthMessage ? 'messageItem--full' : ''} ${alias?.messageType &&
className={`messageItem ${
isMyMessage ? 'messageItem--right' : ''
} ${isFullWidthMessage ? 'messageItem--full' : ''} ${
alias?.messageType &&
`${alias?.messageType.toLowerCase()} systemMessage`
}`}
}`}
>
{getMessageDate()}
<div
className={`
messageItem__messageWrap
${isMyMessage ? 'messageItem__messageWrap--right' : ''}
${isFurtherStepsMessage ? 'messageItem__messageWrap--furtherSteps' : ''}
${isE2EEActivatedMessage
? 'messageItem__messageWrap--e2eeActivatedMessage'
: ''
${
isE2EEActivatedMessage
? 'messageItem__messageWrap--e2eeActivatedMessage'
: ''
}
`}
>
Expand Down
13 changes: 6 additions & 7 deletions src/components/message/message.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ $message-attachment-color: $secondary !default;
&::after {
content: '';
display: inline-block;
border-top: 1px solid var(--skin-color-secondary-contrast-safe, $text-divider-color);
border-top: 1px solid
var(--skin-color-secondary-contrast-safe, $text-divider-color);
width: $grid-base-three;
vertical-align: middle;
margin: 0 $grid-base;
Expand All @@ -134,7 +135,7 @@ $message-attachment-color: $secondary !default;
}
}

&+.messageItem__divider {
& + .messageItem__divider {
margin-top: 12px;
}
}
Expand Down Expand Up @@ -189,11 +190,11 @@ $message-attachment-color: $secondary !default;
display: flex;
flex-direction: column;

&>* {
& > * {
margin-top: $grid-base;
}

&>*:first-child {
& > *:first-child {
margin-top: 0;
}
}
Expand Down Expand Up @@ -496,7 +497,6 @@ $message-attachment-color: $secondary !default;
}

@keyframes success {

100%,
0% {
transform: translate(-50%, 0) scale(0);
Expand All @@ -511,7 +511,6 @@ $message-attachment-color: $secondary !default;
}

@keyframes successCopyReverse {

100%,
0% {
transform: scale(1);
Expand All @@ -523,4 +522,4 @@ $message-attachment-color: $secondary !default;
transform: scale(0);
opacity: 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const MessageSubmitInterfaceComponent = ({
const [isRichtextActive, setIsRichtextActive] = useState(false);
const [isConsultantAbsent, setIsConsultantAbsent] = useState(
hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) &&
activeSession.consultant?.absent
activeSession.consultant?.absent
);
const [isSessionArchived, setIsSessionArchived] = useState(
activeSession.item.status === STATUS_ARCHIVED
Expand Down Expand Up @@ -234,7 +234,7 @@ export const MessageSubmitInterfaceComponent = ({
useTimeoutOverlay(
// Disable the request overlay if upload is in progess because upload progress is shown in the ui already
isRequestInProgress &&
!(uploadProgress > 0 && uploadProgress < 100),
!(uploadProgress > 0 && uploadProgress < 100),
null,
null,
null,
Expand All @@ -244,13 +244,13 @@ export const MessageSubmitInterfaceComponent = ({
useEffect(() => {
setIsConsultantAbsent(
hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) &&
activeSession.consultant?.absent
activeSession.consultant?.absent
);
setIsSessionArchived(activeSession.item.status === STATUS_ARCHIVED);
setIsTypingActive(activeSession.isGroup || activeSession.isLive);
setIsLiveChatFinished(
activeSession.isLive &&
activeSession.item.status === STATUS_FINISHED
activeSession.item.status === STATUS_FINISHED
);
}, [activeSession, activeSession.item.status, userData]);

Expand Down Expand Up @@ -373,7 +373,7 @@ export const MessageSubmitInterfaceComponent = ({
if (
draftLoaded &&
currentEditorState.getCurrentContent() !==
editorState.getCurrentContent() &&
editorState.getCurrentContent() &&
isTyping
) {
isTyping(!currentEditorState.getCurrentContent().hasText());
Expand Down Expand Up @@ -441,11 +441,11 @@ export const MessageSubmitInterfaceComponent = ({
let textInputStyles = `min-height: ${currentInputHeight}px; ${currentOverflow} ${textInputMarginTop} ${textInputMarginBottom}`;
textInputStyles = isRichtextActive
? textInputStyles +
`border-top: none; border-top-right-radius: 0; box-shadow: none;`
`border-top: none; border-top-right-radius: 0; box-shadow: none;`
: textInputStyles;
textInputStyles = attachmentSelected
? textInputStyles +
`border-bottom: none; border-bottom-right-radius: 0;`
`border-bottom: none; border-bottom-right-radius: 0;`
: textInputStyles;
textInput?.setAttribute('style', textInputStyles);

Expand Down Expand Up @@ -504,11 +504,7 @@ export const MessageSubmitInterfaceComponent = ({
}, [onMessageSendSuccess, resizeTextarea]);

const sendMessage = useCallback(
async (
message,
attachment: File,
isEncrypted
) => {
async (message, attachment: File, isEncrypted) => {
const sendToRoomWithId = activeSession.rid || activeSession.item.id;
const getSendMailNotificationStatus = () =>
!activeSession.isGroup && !activeSession.isLive;
Expand Down Expand Up @@ -665,11 +661,7 @@ export const MessageSubmitInterfaceComponent = ({
return;
}

await sendMessage(
message,
attachment,
isEncrypted
);
await sendMessage(message, attachment, isEncrypted);
}, [

Check warning on line 665 in src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx

View workflow job for this annotation

GitHub Actions / ESLint

src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx#L665

React Hook useCallback has an unnecessary dependency: 'setE2EEState'. Either exclude it or remove the dependency array (react-hooks/exhaustive-deps)
encrypted,
getTypedMarkdownMessage,
Expand Down Expand Up @@ -781,10 +773,11 @@ export const MessageSubmitInterfaceComponent = ({
const contact = getContact(activeSession);
infoData = {
isInfo: true,
infoHeadline: `${contact?.displayName ||
infoHeadline: `${
contact?.displayName ||
contact?.username ||
translate('sessionList.user.consultantUnknown')
} ${translate('consultant.absent.message')} `,
} ${translate('consultant.absent.message')} `,
infoMessage: activeSession.consultant.absenceMessage
};
} else if (activeInfo === INFO_TYPES.ATTACHMENT_SIZE_ERROR) {
Expand Down Expand Up @@ -886,9 +879,7 @@ export const MessageSubmitInterfaceComponent = ({
)}
{activeInfo && <MessageSubmitInfo {...getMessageSubmitInfo()} />}
{!isLiveChatFinished && (
<form
className="textarea"
>
<form className="textarea">
<div className={'textarea__wrapper'}>
<div className="textarea__wrapper-send-message">
<span className="textarea__featureWrapper">
Expand Down
7 changes: 4 additions & 3 deletions src/components/session/AcceptLiveChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ export const AcceptLiveChatView = ({
semanticLevel="3"
text={`${translate(
'enquiry.anonymous.infoLabel.start'
)}${getContact(activeSession)?.username ||
translate('sessionList.user.consultantUnknown')
}${translate('enquiry.anonymous.infoLabel.end')}`}
)}${
getContact(activeSession)?.username ||
translate('sessionList.user.consultantUnknown')
}${translate('enquiry.anonymous.infoLabel.end')}`}
/>
</div>

Expand Down
23 changes: 10 additions & 13 deletions src/components/session/SessionItemComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ export const SessionItemComponent = (props: SessionItemProps) => {
);

useEffect(() => {
setCanWriteMessage(
type !== SESSION_LIST_TYPES.ENQUIRY
);
setCanWriteMessage(type !== SESSION_LIST_TYPES.ENQUIRY);
}, [type, userData]);

const resetUnreadCount = () => {
Expand Down Expand Up @@ -310,7 +308,7 @@ export const SessionItemComponent = (props: SessionItemProps) => {
if (
trackedErrorIndex >= 0 &&
acc[trackedErrorIndex][1].message ===
collectedError.message
collectedError.message
) {
if (timestamp > acc[trackedErrorIndex][0]) {
acc.splice(
Expand Down Expand Up @@ -343,14 +341,12 @@ export const SessionItemComponent = (props: SessionItemProps) => {
);

return (
<div
className="session"
>
<div className="session">
<div ref={headerRef}>
<SessionHeaderComponent
consultantAbsent={
activeSession.consultant &&
activeSession.consultant.absent
activeSession.consultant.absent
? activeSession.consultant
: null
}
Expand Down Expand Up @@ -409,10 +405,11 @@ export const SessionItemComponent = (props: SessionItemProps) => {
</React.Fragment>
))}
<div
className={`session__scrollToBottom ${isScrolledToBottom
? 'session__scrollToBottom--disabled'
: ''
}`}
className={`session__scrollToBottom ${
isScrolledToBottom
? 'session__scrollToBottom--disabled'
: ''
}`}
>
{newMessages > 0 && (
<span className="session__unreadCount">
Expand Down Expand Up @@ -452,7 +449,7 @@ export const SessionItemComponent = (props: SessionItemProps) => {
className={clsx(
'session__submit-interface',
!isScrolledToBottom &&
'session__submit-interface--scrolled-up'
'session__submit-interface--scrolled-up'
)}
placeholder={getPlaceholder()}
typingUsers={props.typingUsers}
Expand Down
Loading

0 comments on commit 2e6e119

Please sign in to comment.