Skip to content

Commit b34916c

Browse files
committed
add domain
1 parent c7cf2b0 commit b34916c

File tree

6 files changed

+16
-3
lines changed

6 files changed

+16
-3
lines changed

special-pages/pages/history/app/components/Item.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ export const Item = memo(
1313
* @param {string} props.id - A unique identifier for the item.
1414
* @param {string} props.title - The text to be displayed for the item.
1515
* @param {string} props.url - The text to be displayed for the item.
16+
* @param {string} props.domain - The text to be displayed for the domain
1617
* @param {number} props.kind - The kind or type of the item that determines its visual style.
1718
* @param {string} props.dateRelativeDay - The relative day information to display (shown when kind is equal to TITLE_KIND).
1819
* @param {string} props.dateTimeOfDay - the time of day, like 11.00am.
1920
*/
20-
function Item({ id, url, title, kind, dateRelativeDay, dateTimeOfDay }) {
21+
function Item({ id, url, domain, title, kind, dateRelativeDay, dateTimeOfDay }) {
2122
return (
2223
<Fragment>
2324
{kind === TITLE_KIND && (
@@ -32,7 +33,7 @@ export const Item = memo(
3233
<a href={url} data-url={url} class={styles.entryLink}>
3334
{title}
3435
</a>
35-
<span class={styles.url}>{url}</span>
36+
<span class={styles.domain}>{domain}</span>
3637
<span class={styles.time}>{dateTimeOfDay}</span>
3738
<button class={styles.dots} data-row-menu={id}>
3839
<Dots />

special-pages/pages/history/app/components/Item.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
color: inherit;
5555
}
5656

57-
.url {
57+
.domain {
5858
font-weight: 400;
5959
display: block;
6060
white-space: nowrap;

special-pages/pages/history/app/components/Results.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export function Results({ results }) {
2424
id={item.id}
2525
kind={results.value.heights[index]}
2626
url={item.url}
27+
domain={item.domain}
2728
title={item.title}
2829
dateRelativeDay={item.dateRelativeDay}
2930
dateTimeOfDay={item.dateTimeOfDay}

special-pages/pages/history/app/mocks/history.mocks.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const historyMocks = {
1515
dateTimeOfDay: '11:10',
1616
title: 'Electric Callboy - Hypa Hypa (OFFICIAL VIDEO) - YouTube',
1717
url: 'https://www.youtube.com/watch?v=75Mw8r5gW8E',
18+
domain: 'www.youtube.com',
1819
},
1920
{
2021
id: 'history-id-02',
@@ -23,6 +24,7 @@ export const historyMocks = {
2324
dateTimeOfDay: '11:01',
2425
title: 'Sonos continues to clean house with departure of chief commercial officer - The Verge',
2526
url: 'https://www.theverge.com/2025/1/15/24344430/sonos-cco-deirdre-findlay-leaving',
27+
domain: 'www.theverge.com',
2628
},
2729
{
2830
id: 'history-id-03',
@@ -31,6 +33,7 @@ export const historyMocks = {
3133
dateTimeOfDay: '16:45',
3234
title: 'PreactJS/preact: Fast 3kB React alternative with the same API. Components & Virtual DOM. - GitHub',
3335
url: 'https://github.com/preactjs/preact',
36+
domain: 'github.com',
3437
},
3538
],
3639
},

special-pages/pages/history/messages/types/history-item.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
"format": "hostname",
3434
"description": "The eTLD+1 version of the domain, representing the domain and its top-level domain (e.g., 'example.com', 'localhost'). This differs from 'domain', which may include subdomains (e.g., 'www.youtube.com')."
3535
},
36+
"domain": {
37+
"type": "string",
38+
"description": "The full domain to show beside the site title, eg: 'www.youtube.com'"
39+
},
3640
"title": {
3741
"type": "string",
3842
"description": "Title of the page (e.g., 'YouTube')."

special-pages/pages/history/types/history.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ export interface HistoryItem {
147147
* The eTLD+1 version of the domain, representing the domain and its top-level domain (e.g., 'example.com', 'localhost'). This differs from 'domain', which may include subdomains (e.g., 'www.youtube.com').
148148
*/
149149
etldPlusOne?: string;
150+
/**
151+
* The full domain to show beside the site title, eg: 'www.youtube.com'
152+
*/
153+
domain: string;
150154
/**
151155
* Title of the page (e.g., 'YouTube').
152156
*/

0 commit comments

Comments
 (0)