From 0ebfd60ded66c82cf96f4c73c363f8a2dbb38d7a Mon Sep 17 00:00:00 2001 From: ARREY-ETTA BESSONG EKEP OBASI Date: Fri, 19 Apr 2024 00:17:24 +0100 Subject: [PATCH 1/2] style: redesign the transcript word limit more and less text --- src/components/App/SideBar/Transcript/index.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/App/SideBar/Transcript/index.tsx b/src/components/App/SideBar/Transcript/index.tsx index 8e26de282..6195b27b6 100644 --- a/src/components/App/SideBar/Transcript/index.tsx +++ b/src/components/App/SideBar/Transcript/index.tsx @@ -5,11 +5,11 @@ import styled from 'styled-components' import CopyIcon from '~/components/Icons/CopyIcon' import NotesIcon from '~/components/Icons/NotesIcon' import { Flex } from '~/components/common/Flex' +import { getFullTranscript } from '~/network/fetchSourcesData' import { useAppStore } from '~/stores/useAppStore' import { NodeExtended } from '~/types' import { colors } from '~/utils/colors' import CheckIcon from '../../../Icons/CheckIcon' -import { getFullTranscript } from '~/network/fetchSourcesData' type TranscriptProps = { stateless?: boolean @@ -19,9 +19,13 @@ type TranscriptProps = { const MoreText = styled.span` color: ${colors.white}; cursor: pointer; - margin-left: 5px; + text-transform: uppercase; + font-weight: 500; + font-size: 12px; + text-align: right; + &:hover { - text-decoration: underline; + color: ${colors.GRAY3}; } ` @@ -122,8 +126,8 @@ export const Transcript = ({ stateless, node }: TranscriptProps) => { )} - {showFullTranscript ? fullTranscript : `${node?.text?.substring(0, 100)}...`} - {showFullTranscript ? 'less' : 'more'} + {showFullTranscript ? fullTranscript : `${node?.text?.substring(0, 100)}`} + ... {showFullTranscript ? 'show less' : 'more'} ) @@ -169,7 +173,6 @@ const CloseButton = styled(Flex).attrs({})` const Box = styled(Flex)` color: ${colors.white}; - text-overflow: ellipsis; whitespace: nowrap; font-family: Barlow; letter-spacing: 0.2pt; From bcb6f7649e08f809cc5af319a05e15114839b067 Mon Sep 17 00:00:00 2001 From: ARREY-ETTA BESSONG EKEP OBASI Date: Sat, 20 Apr 2024 01:35:07 +0100 Subject: [PATCH 2/2] fix: failing tests --- .../SettingsView/GraphBlueprint/__tests__/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/SettingsModal/SettingsView/GraphBlueprint/__tests__/index.tsx b/src/components/SettingsModal/SettingsView/GraphBlueprint/__tests__/index.tsx index 2026b5361..3b17f5885 100644 --- a/src/components/SettingsModal/SettingsView/GraphBlueprint/__tests__/index.tsx +++ b/src/components/SettingsModal/SettingsView/GraphBlueprint/__tests__/index.tsx @@ -1,6 +1,6 @@ -import React from 'react' -import { render, screen } from '@testing-library/react' import '@testing-library/jest-dom' +import { render, screen, waitFor } from '@testing-library/react' +import React from 'react' import { GraphBlueprint } from '../index' jest.mock('../../../../../network/fetchSourcesData', () => ({ @@ -15,8 +15,10 @@ describe('GraphBlueprint', () => { it('should display only one Custom node', async () => { render() - const customNodes = await screen.findAllByText('Custom') + waitFor(async () => { + const customNodes = await screen.findAllByText('Custom') - expect(customNodes).toHaveLength(1) + expect(customNodes).toHaveLength(1) + }) }) })