Commit d7849a27 authored by Patrik Kotucek's avatar Patrik Kotucek
Browse files

fix: remove divider and help icon

parent 072d264e
Loading
Loading
Loading
Loading
+42 −33
Original line number Diff line number Diff line
@@ -10,11 +10,15 @@ import {
} from '@blueprintjs/core'
import { Shield } from '@blueprintjs/icons'
import { css, cx } from '@emotion/css'
import { SetTimestampRead, useTypedMutation } from '@inject/graphql'
import {
  LLMEnabledQuery,
  SetTimestampRead,
  useTypedMutation,
  useTypedQuery,
} from '@inject/graphql'
import { useTranslationFrontend } from '@inject/locale'
import {
  breakWord,
  HelpIcon,
  LinkButton,
  notifyNoncommmit,
  Timestamp,
@@ -89,6 +93,11 @@ export const EmailCard: FC<{
  markDoneAvailable,
}) => {
  const [, setTimestampRead] = useTypedMutation(SetTimestampRead)
  const [{ data: llmData, fetching: llmFetching }] = useTypedQuery({
    query: LLMEnabledQuery,
    variables: { exerciseId },
    pause: !assessmentProps,
  })
  const { t } = useTranslationFrontend()
  const { toggleDone } = useToggleDone(
    email.__typename === 'IActionLogType'
@@ -127,6 +136,9 @@ export const EmailCard: FC<{
  ])

  const definitionAddress = email.details.sender.definitionAddress
  const llmEnabled = llmData?.exerciseId.llm ?? false
  const showAssessment = !!assessmentProps && llmEnabled
  const showDivider = !assessmentProps || (!llmFetching && !llmEnabled)

  const MarkAsDoneAndNotify = () => {
    toggleDone()
@@ -268,9 +280,12 @@ export const EmailCard: FC<{
          />
        ))}

        {assessmentProps && <Assessment {...assessmentProps} />}
        <Divider />
        {showAssessment && assessmentProps && (
          <Assessment {...assessmentProps} />
        )}
        {markDoneAvailable && teamId && !email.done && (
          <>
            {showDivider && <Divider />}
            <div className={buttonGroupRow}>
              <ButtonGroup>
                <Button icon='changes' onClick={MarkAsDoneAndNotify}>
@@ -284,13 +299,6 @@ export const EmailCard: FC<{
                      text: (
                        <span className={buttonTextWithHelp}>
                          {t('overview.todoList.markAsDoneAndReturn')}
                        <HelpIcon
                          text={
                            <p>
                              {t('overview.todoList.markAsDoneAndReturnHelp')}
                            </p>
                          }
                        />
                        </span>
                      ),
                      minimal: true,
@@ -300,6 +308,7 @@ export const EmailCard: FC<{
                )}
              </ButtonGroup>
            </div>
          </>
        )}
      </SectionCard>
    </Section>
+0 −1
Original line number Diff line number Diff line
@@ -519,7 +519,6 @@
      "notDone": "Nedokončeno",
      "notFoundTitle": "Žádné injecty",
      "notFoundDescription": "Nebyly nalezeny žádné injecty, které by mohly být zobrazeny v téhle kategorii. Prosím počkejte na nové",
      "markAsDoneAndReturnHelp": "Označí email jako dokončený a vrátí vás zpět na přehled cvičení.",
      "notification": {
        "description": "Email byl označen jako dokončený",
        "undo": "Vrátit zpět"
+0 −1
Original line number Diff line number Diff line
@@ -519,7 +519,6 @@
      "notDone": "Not done",
      "notFoundTitle": "No inject items",
      "notFoundDescription": "There are no log items that can be shown in this category. Please await for new injects",
      "markAsDoneAndReturnHelp": "Marks the email as done and returns to the exercise overview.",
      "notification": {
        "description": "Email was marked as done",
        "undo": "Undo"