From af389129540ba58c9a2e552fc849028b7f67efe1 Mon Sep 17 00:00:00 2001 From: Hristo Nedelkov Date: Tue, 21 Nov 2023 12:09:21 +0200 Subject: [PATCH] Add random names to locate rows --- src/pages/LogsPage/TerminalRow.tsx | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/pages/LogsPage/TerminalRow.tsx b/src/pages/LogsPage/TerminalRow.tsx index a9c3f708..c56d338b 100644 --- a/src/pages/LogsPage/TerminalRow.tsx +++ b/src/pages/LogsPage/TerminalRow.tsx @@ -1,5 +1,7 @@ import { Text } from '@status-im/components' import { Stack, XStack } from 'tamagui' +import faker from 'faker'; + type DataType = { option: string description: string @@ -8,6 +10,12 @@ interface RowProps { data: DataType | undefined index: number } +function cutSentenceToRandomWords(sentence: string) { + const randomLength = Math.floor(Math.random() * 100) + 1 + let words = sentence.split(' ') + let slicedWords = words.slice(0, randomLength) + return slicedWords.join(' ') +} const TerminalRow = ({ data, index }: RowProps) => { if (!data) { @@ -15,7 +23,12 @@ const TerminalRow = ({ data, index }: RowProps) => { } const { option, description } = data - + + + const name: string = faker.name.findName(); + const email: string = faker.internet.email(); + + return ( { {index} - {new Date(Date.now()).getHours()}h:{new Date(Date.now()).getMinutes()}m: - {new Date(Date.now()).getSeconds()}s + {new Date(Date.now()).getHours()}:{new Date(Date.now()).getMinutes()}: + {new Date(Date.now()).getSeconds()} { marginRight: '20px', marginLeft: '20px', wordWrap: 'break-word', - maxWidth: '80%', + maxWidth: '89%', height: '100%', }} > - {option} {description} Lorem ipsum dolor sit amet consectetur adipisicing elit. Quidem + {option} {randomName}{' '} + {cutSentenceToRandomWords(` + Lorem ipsum dolor sit amet consectetur adipisicing elit. Quidem nobis, numquam non rerum illo eligendi quaerat neque mollitia temporibus quam placeat repellat asperiores veritatis officiis unde sed praesentium obcaecati nihil? Quasi, quae - eveniet cupiditate mollitia est facilis ea vero, aperiam dolore dolor doloribus labore - - + eveniet cupiditate mollitia est facilis ea vero, aperiam dolore dolor doloribus labore`)} )