Skip to content

Commit 7b8266d

Browse files
authored
history: support some customizer styles (#1698)
1 parent 2d62df4 commit 7b8266d

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

special-pages/pages/history/app/history.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ With {@link "History Messages".DefaultStyles} overrides
3333
"platform": {
3434
"name": "macos"
3535
},
36-
"defaultStyles": {
37-
"lightBackgroundColor": "#E9EBEC",
38-
"darkBackgroundColor": "#27282A"
36+
"customizer": {
37+
"defaultStyles": {
38+
"lightBackgroundColor": "#E9EBEC",
39+
"darkBackgroundColor": "#27282A"
40+
}
3941
}
4042
}
4143
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function init(root, messaging, baseEnvironment) {
6060
};
6161

6262
// apply default styles
63-
applyDefaultStyles(init.defaultStyles);
63+
applyDefaultStyles(init.customizer?.defaultStyles);
6464

6565
const strings = await getStrings(environment);
6666
const service = new HistoryService(messaging);

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ export function mockTransport() {
157157
platform: { name: 'integration' },
158158
env: 'development',
159159
locale: 'en',
160-
defaultStyles: getDefaultStyles(),
160+
customizer: {
161+
defaultStyles: getDefaultStyles(),
162+
},
161163
};
162164

163165
return Promise.resolve(initial);

special-pages/pages/history/messages/initialSetup.response.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,20 @@
2020
}
2121
}
2222
},
23-
"defaultStyles": {
24-
"oneOf": [
25-
{
26-
"type": "null"
27-
},
28-
{
29-
"$ref": "types/default-styles.json"
23+
"customizer": {
24+
"type": "object",
25+
"properties": {
26+
"defaultStyles": {
27+
"oneOf": [
28+
{
29+
"type": "null"
30+
},
31+
{
32+
"$ref": "../../new-tab/messages/types/default-styles.json"
33+
}
34+
]
3035
}
31-
]
36+
}
3237
}
3338
}
3439
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ export interface InitialSetupResponse {
196196
platform: {
197197
name: "macos" | "windows" | "android" | "ios" | "integration";
198198
};
199-
defaultStyles?: null | DefaultStyles;
199+
customizer?: {
200+
defaultStyles?: null | DefaultStyles;
201+
};
200202
}
201203
export interface DefaultStyles {
202204
/**

0 commit comments

Comments
 (0)