Skip to content

Commit

Permalink
Layout improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Nov 7, 2024
1 parent 7860298 commit 9354905
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 31 deletions.
40 changes: 17 additions & 23 deletions components/measurement/CommonDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,37 +139,31 @@ const CommonDetails = ({
return (
<>
{showResolverItems && (
<div className="flex my-8">
{/* Resolver data */}
<DetailsBoxTable
title={
<FormattedMessage id="Measurement.CommonDetails.Label.Resolver" />
}
items={resolverItems}
/>
</div>
// Resolver data
<DetailsBoxTable
title={
<FormattedMessage id="Measurement.CommonDetails.Label.Resolver" />
}
items={resolverItems}
/>
)}
<div className="flex my-8">
{/* Metadata: platform, probe, MK version etc. */}
<DetailsBoxTable items={items} className="bg-gray-200" />
</div>
{/* Metadata: platform, probe, MK version etc. */}
<DetailsBoxTable items={items} className="bg-gray-200" />
{/* User Feedback */}
{!!userFeedbackItems.length && (
<div className="flex my-8">
<DetailsBoxTable
title={
<FormattedMessage id="Measurement.CommonDetails.Label.UserFeedback" />
}
items={userFeedbackItems}
/>
</div>
<DetailsBoxTable
title={
<FormattedMessage id="Measurement.CommonDetails.Label.UserFeedback" />
}
items={userFeedbackItems}
/>
)}
{/* Raw Measurement */}
<div className="flex">
<DetailsBox
title={
<div className="flex flex-1 px-4 justify-between flex-col md:flex-row items-center bg-gray-200">
<div>
<div className="flex flex-1 justify-between flex-col md:flex-row items-center bg-gray-200">
<div className="self-start">
{intl.formatMessage({
id: 'Measurement.CommonDetails.RawMeasurement.Heading',
})}
Expand Down
1 change: 0 additions & 1 deletion components/measurement/CommonSummary.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Link from 'next/link'
import { useRouter } from 'next/router'
import PropTypes from 'prop-types'
import { useContext } from 'react'
import { MdOutlineFactCheck } from 'react-icons/md'
Expand Down
5 changes: 2 additions & 3 deletions components/measurement/DetailsBox.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useRouter } from 'next/router'
import PropTypes from 'prop-types'
import { useCallback, useContext, useState } from 'react'
import { MdExpandLess } from 'react-icons/md'
Expand All @@ -11,7 +10,7 @@ export const DetailsBoxTable = ({ title, items, className }) => (
className={className}
content={items.map((item, index) => (
<div className="flex flex-wrap" key={index}>
<div className="md:w-1/4 font-bold">{item.label}</div>
<div className="md:w-1/4 font-bold pe-4">{item.label}</div>
<div className="md:w-3/4 break-words">{item.value}</div>
</div>
))}
Expand Down Expand Up @@ -47,7 +46,7 @@ export const DetailsBox = ({

return (
<div
className={twMerge('border-2 border-gray-200 w-full mb-4', className)}
className={twMerge('border-2 border-gray-200 w-full mb-8', className)}
{...rest}
>
{title &&
Expand Down
5 changes: 4 additions & 1 deletion components/measurement/StatusInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import PropTypes from 'prop-types'

const StatusInfo = ({ title, message }) => (
<div className="flex flex-col">
<div className="text-center text-3xl mb-3 break-words"> {title} </div>
<div className="text-center text-2xl md:text-3xl mb-3 break-words">
{' '}
{title}{' '}
</div>
<div className="text-center text-lg font-bold whitespace-pre">
{' '}
{message}{' '}
Expand Down
2 changes: 1 addition & 1 deletion components/measurement/SummaryText.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const SummaryText = ({ testName, network, country, date, content }) => {
}
return (
<div className="flex">
<div className="py-8 text-xl">{textToRender}</div>
<div className="py-8 text-base md:text-xl">{textToRender}</div>
</div>
)
}
Expand Down
3 changes: 1 addition & 2 deletions components/measurement/nettests/WebConnectivity.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import bufferFrom from 'buffer-from'
import deepmerge from 'deepmerge'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { Cross, Tick } from 'ooni-components/icons'
import PropTypes from 'prop-types'
import { Fragment, useContext } from 'react'
Expand Down Expand Up @@ -131,7 +130,7 @@ const FailureString = ({ failure }) => {
}

return (
<div>
<div className="flex">
<Cross size={20} /> {failure}
</div>
)
Expand Down

0 comments on commit 9354905

Please sign in to comment.