-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: change file summary location (#701)
#595 - changes file summary location + style - changes style of subtitles in run overview - fetches frame data
- Loading branch information
Showing
6 changed files
with
138 additions
and
33 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
frontend/packages/data-portal/app/components/InlineMetadata.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { cns } from 'app/utils/cns' | ||
|
||
export interface Metadata { | ||
key: string | ||
value: string | ||
uppercase?: boolean | ||
} | ||
|
||
export function InlineMetadata({ | ||
label, | ||
fields, | ||
subheader = false, | ||
}: { | ||
label?: string | ||
fields: Metadata[] | ||
subheader?: boolean | ||
}) { | ||
const fieldsRender = ( | ||
<ul className="list-none flex gap-sds-l items-baseline"> | ||
{fields.map(({ key, value, uppercase }) => ( | ||
<li | ||
className={cns( | ||
'flex flex-row items-baseline justify-left gap-sds-xxs', | ||
subheader && 'text-sds-gray-500', | ||
)} | ||
key={key + value} | ||
> | ||
<span | ||
className={cns( | ||
'font-semibold', | ||
subheader | ||
? 'text-sds-gray-600 tracking-sds-caps text-sds-caps-xxs leading-sds-caps-xxs' | ||
: 'text-sds-body-xxs leading-sds-body-xxs', | ||
uppercase && 'uppercase', | ||
subheader && uppercase && 'tracking-sds-caps', | ||
)} | ||
> | ||
{key}: | ||
</span> | ||
|
||
<span | ||
className={ | ||
subheader | ||
? 'text-sds-body-s leading-sds-body-s' | ||
: 'text-sds-body-xxs leading-sds-body-xxs' | ||
} | ||
> | ||
{value} | ||
</span> | ||
</li> | ||
))} | ||
</ul> | ||
) | ||
|
||
if (label) { | ||
return ( | ||
<div className="flex flex-row gap-sds-xl text-sds-gray-black items-baseline"> | ||
<span className="text-sds-caps-xxxs leading-sds-caps-xxxs font-semibold uppercase tracking-sds-caps"> | ||
{label} | ||
</span> | ||
{fieldsRender} | ||
</div> | ||
) | ||
} | ||
|
||
return fieldsRender | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters