@twreporter/universal-header 2.3.0 → 2.4.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/lib/components/action-button-old.js +5 -5
- package/lib/components/action-button.js +8 -5
- package/lib/components/channels-old.js +8 -8
- package/lib/components/channels.js +17 -5
- package/lib/components/drop-down-menu.js +2 -2
- package/lib/components/hamburger-footer.js +156 -0
- package/lib/components/hamburger-footer.stories.js +75 -0
- package/lib/components/hamburger-icons.js +11 -11
- package/lib/components/hamburger-menu-item.js +174 -0
- package/lib/components/hamburger-menu-item.stories.js +150 -0
- package/lib/components/hamburger-menu-old.js +148 -0
- package/lib/components/hamburger-menu.js +309 -96
- package/lib/components/hamburger-menu.stories.js +64 -0
- package/lib/components/header-old.js +5 -5
- package/lib/components/header.js +160 -32
- package/lib/components/header.stories.js +16 -7
- package/lib/components/icons-old.js +9 -9
- package/lib/components/icons.js +5 -5
- package/lib/components/mobile-header.js +12 -12
- package/lib/components/search-box.js +2 -2
- package/lib/components/slogan-old.js +2 -2
- package/lib/components/slogan.js +1 -1
- package/lib/constants/actions.js +5 -11
- package/lib/constants/channels-old.js +41 -0
- package/lib/constants/channels.js +58 -25
- package/lib/constants/external-links.js +7 -1
- package/lib/constants/footer.js +24 -0
- package/lib/constants/hamburger-menu.js +13 -0
- package/lib/constants/prop-types-old.js +46 -0
- package/lib/constants/prop-types.js +26 -20
- package/lib/constants/social-media.js +16 -0
- package/lib/containers/header-old.js +11 -11
- package/lib/containers/header.js +23 -44
- package/lib/contexts/header-context.js +6 -7
- package/lib/standalone-header.js +7 -7
- package/lib/utils/links-old.js +177 -0
- package/lib/utils/links.js +60 -66
- package/lib/utils/theme-old.js +345 -0
- package/lib/utils/theme.js +49 -243
- package/package.json +4 -4
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _categories = require("../constants/categories");
|
|
9
|
+
|
|
10
|
+
var _channelsOld = require("../constants/channels-old");
|
|
11
|
+
|
|
12
|
+
var _services = require("../constants/services");
|
|
13
|
+
|
|
14
|
+
var _actionsOld = require("../constants/actions-old");
|
|
15
|
+
|
|
16
|
+
var _externalLinks = _interopRequireDefault(require("../constants/external-links"));
|
|
17
|
+
|
|
18
|
+
var _requestOrigins = _interopRequireDefault(require("@twreporter/core/lib/constants/request-origins"));
|
|
19
|
+
|
|
20
|
+
var _releaseBranch = _interopRequireDefault(require("@twreporter/core/lib/constants/release-branch"));
|
|
21
|
+
|
|
22
|
+
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
+
|
|
28
|
+
var _ = {
|
|
29
|
+
forEach: _forEach["default"]
|
|
30
|
+
};
|
|
31
|
+
var originsForClient = _requestOrigins["default"].forClientSideRendering;
|
|
32
|
+
/**
|
|
33
|
+
* @param {string} domain - one of 'account', 'main', 'support', or 'api'
|
|
34
|
+
* @returns {Object}
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
function getOriginsByType(domain) {
|
|
38
|
+
var baseURL = {};
|
|
39
|
+
|
|
40
|
+
_.forEach(_releaseBranch["default"], function (branch) {
|
|
41
|
+
baseURL[branch] = originsForClient[branch][domain];
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
return baseURL;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var accountsBaseURL = getOriginsByType('accounts');
|
|
48
|
+
var apiBaseURL = getOriginsByType('api');
|
|
49
|
+
var mainBaseURL = getOriginsByType('main'); // const support = getOriginsByType('support')
|
|
50
|
+
|
|
51
|
+
var defaultReleaseBranch = _releaseBranch["default"].master;
|
|
52
|
+
var defaultIsExternal = false;
|
|
53
|
+
|
|
54
|
+
function __getLinks(isExternal, releaseBranch, baseURL, paths) {
|
|
55
|
+
var rtn = {};
|
|
56
|
+
|
|
57
|
+
if (isExternal) {
|
|
58
|
+
if (baseURL.hasOwnProperty(releaseBranch)) {
|
|
59
|
+
for (var key in paths) {
|
|
60
|
+
rtn[key] = {
|
|
61
|
+
to: baseURL[releaseBranch] + paths[key],
|
|
62
|
+
isExternal: isExternal
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return rtn;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
for (var _key in paths) {
|
|
71
|
+
rtn[_key] = {
|
|
72
|
+
to: paths[_key],
|
|
73
|
+
isExternal: isExternal
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return rtn;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function __getLink(isExternal, releaseBranch, baseURL, path) {
|
|
81
|
+
if (isExternal) {
|
|
82
|
+
if (baseURL.hasOwnProperty(releaseBranch)) {
|
|
83
|
+
return {
|
|
84
|
+
to: baseURL[releaseBranch] + path,
|
|
85
|
+
isExternal: isExternal
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
to: path,
|
|
92
|
+
isExternal: isExternal
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function __getExternalLinks() {
|
|
97
|
+
return Object.assign({}, _externalLinks["default"]);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function getCategoryLinks() {
|
|
101
|
+
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
102
|
+
var releaseBranch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultReleaseBranch;
|
|
103
|
+
return __getLinks(isExternal, releaseBranch, mainBaseURL, _categories.categoryPathnames);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function getChannelLinks() {
|
|
107
|
+
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
108
|
+
var releaseBranch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultReleaseBranch;
|
|
109
|
+
return __getLinks(isExternal, releaseBranch, mainBaseURL, _channelsOld.channelPathnames);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function getLogoutLink() {
|
|
113
|
+
var releaseBranch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultReleaseBranch;
|
|
114
|
+
return {
|
|
115
|
+
to: apiBaseURL[releaseBranch] + _services.servicePathnames.logout,
|
|
116
|
+
isExternal: true
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function getLoginLink() {
|
|
121
|
+
var releaseBranch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultReleaseBranch;
|
|
122
|
+
return {
|
|
123
|
+
to: accountsBaseURL[releaseBranch] + _services.servicePathnames.login,
|
|
124
|
+
isExternal: true
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function getBookmarksLink() {
|
|
129
|
+
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
130
|
+
var releaseBranch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultReleaseBranch;
|
|
131
|
+
return __getLink(isExternal, releaseBranch, mainBaseURL, _services.servicePathnames.bookmarks);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function getSearchLink() {
|
|
135
|
+
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
136
|
+
var releaseBranch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultReleaseBranch;
|
|
137
|
+
return __getLink(isExternal, releaseBranch, mainBaseURL, _services.servicePathnames.search);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function getLogoLink() {
|
|
141
|
+
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
142
|
+
var releaseBranch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultReleaseBranch;
|
|
143
|
+
return __getLink(isExternal, releaseBranch, mainBaseURL, '');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function getActionLinks() {
|
|
147
|
+
var _ref;
|
|
148
|
+
|
|
149
|
+
return _ref = {}, _defineProperty(_ref, _actionsOld.actionKeys.support, {
|
|
150
|
+
to: __getExternalLinks().monthlyDonation,
|
|
151
|
+
isExternal: true
|
|
152
|
+
}), _defineProperty(_ref, _actionsOld.actionKeys.newsLetter, {
|
|
153
|
+
to: __getExternalLinks().newsLetter,
|
|
154
|
+
isExternal: true
|
|
155
|
+
}), _ref;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function getServiceLinks() {
|
|
159
|
+
var _ref2;
|
|
160
|
+
|
|
161
|
+
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
162
|
+
var releaseBranch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultReleaseBranch;
|
|
163
|
+
return _ref2 = {}, _defineProperty(_ref2, _services.serviceKeys.bookmarks, getBookmarksLink(isExternal, releaseBranch)), _defineProperty(_ref2, _services.serviceKeys.login, getLoginLink(releaseBranch)), _defineProperty(_ref2, _services.serviceKeys.logout, getLogoutLink(releaseBranch)), _defineProperty(_ref2, _services.serviceKeys.search, getSearchLink(isExternal, releaseBranch)), _ref2;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
var _default = {
|
|
167
|
+
getBookmarksLink: getBookmarksLink,
|
|
168
|
+
getCategoryLinks: getCategoryLinks,
|
|
169
|
+
getChannelLinks: getChannelLinks,
|
|
170
|
+
getServiceLinks: getServiceLinks,
|
|
171
|
+
getLogoLink: getLogoLink,
|
|
172
|
+
getActionLinks: getActionLinks,
|
|
173
|
+
getLoginLink: getLoginLink,
|
|
174
|
+
getLogoutLink: getLogoutLink,
|
|
175
|
+
getSearchLink: getSearchLink
|
|
176
|
+
};
|
|
177
|
+
exports["default"] = _default;
|
package/lib/utils/links.js
CHANGED
|
@@ -3,16 +3,26 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getLogoutLink = getLogoutLink;
|
|
7
|
+
exports.getLoginLink = getLoginLink;
|
|
8
|
+
exports.getBookmarksLink = getBookmarksLink;
|
|
9
|
+
exports.getSearchLink = getSearchLink;
|
|
10
|
+
exports.getLogoLink = getLogoLink;
|
|
6
11
|
exports.getActionLinks = getActionLinks;
|
|
7
|
-
exports
|
|
12
|
+
exports.getFooterLinks = getFooterLinks;
|
|
13
|
+
exports.getSocialMediaLinks = getSocialMediaLinks;
|
|
14
|
+
exports.getChannelLinks = getChannelLinks;
|
|
15
|
+
exports.getCategoryLink = void 0;
|
|
8
16
|
|
|
9
|
-
var
|
|
17
|
+
var _services = require("../constants/services");
|
|
10
18
|
|
|
11
|
-
var
|
|
19
|
+
var _actions = require("../constants/actions");
|
|
12
20
|
|
|
13
|
-
var
|
|
21
|
+
var _footer = require("../constants/footer");
|
|
14
22
|
|
|
15
|
-
var
|
|
23
|
+
var _socialMedia = require("../constants/social-media");
|
|
24
|
+
|
|
25
|
+
var _channels = require("../constants/channels");
|
|
16
26
|
|
|
17
27
|
var _externalLinks = _interopRequireDefault(require("../constants/external-links"));
|
|
18
28
|
|
|
@@ -22,12 +32,15 @@ var _releaseBranch = _interopRequireDefault(require("@twreporter/core/lib/consta
|
|
|
22
32
|
|
|
23
33
|
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
24
34
|
|
|
35
|
+
var _reduce = _interopRequireDefault(require("lodash/reduce"));
|
|
36
|
+
|
|
25
37
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
26
38
|
|
|
27
39
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
28
40
|
|
|
29
41
|
var _ = {
|
|
30
|
-
forEach: _forEach["default"]
|
|
42
|
+
forEach: _forEach["default"],
|
|
43
|
+
reduce: _reduce["default"]
|
|
31
44
|
};
|
|
32
45
|
var originsForClient = _requestOrigins["default"].forClientSideRendering;
|
|
33
46
|
/**
|
|
@@ -52,32 +65,6 @@ var mainBaseURL = getOriginsByType('main'); // const support = getOriginsByType(
|
|
|
52
65
|
var defaultReleaseBranch = _releaseBranch["default"].master;
|
|
53
66
|
var defaultIsExternal = false;
|
|
54
67
|
|
|
55
|
-
function __getLinks(isExternal, releaseBranch, baseURL, paths) {
|
|
56
|
-
var rtn = {};
|
|
57
|
-
|
|
58
|
-
if (isExternal) {
|
|
59
|
-
if (baseURL.hasOwnProperty(releaseBranch)) {
|
|
60
|
-
for (var key in paths) {
|
|
61
|
-
rtn[key] = {
|
|
62
|
-
to: baseURL[releaseBranch] + paths[key],
|
|
63
|
-
isExternal: isExternal
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return rtn;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
for (var _key in paths) {
|
|
72
|
-
rtn[_key] = {
|
|
73
|
-
to: paths[_key],
|
|
74
|
-
isExternal: isExternal
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return rtn;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
68
|
function __getLink(isExternal, releaseBranch, baseURL, path) {
|
|
82
69
|
if (isExternal) {
|
|
83
70
|
if (baseURL.hasOwnProperty(releaseBranch)) {
|
|
@@ -98,11 +85,14 @@ function __getExternalLinks() {
|
|
|
98
85
|
return Object.assign({}, _externalLinks["default"]);
|
|
99
86
|
}
|
|
100
87
|
|
|
101
|
-
function
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
88
|
+
var __composeExternalLink = function __composeExternalLink(link) {
|
|
89
|
+
var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '_self';
|
|
90
|
+
return {
|
|
91
|
+
to: link,
|
|
92
|
+
isExternal: true,
|
|
93
|
+
target: target
|
|
94
|
+
};
|
|
95
|
+
};
|
|
106
96
|
|
|
107
97
|
var getCategoryLink = function getCategoryLink() {
|
|
108
98
|
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
@@ -113,12 +103,6 @@ var getCategoryLink = function getCategoryLink() {
|
|
|
113
103
|
|
|
114
104
|
exports.getCategoryLink = getCategoryLink;
|
|
115
105
|
|
|
116
|
-
function getChannelLinks() {
|
|
117
|
-
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
118
|
-
var releaseBranch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultReleaseBranch;
|
|
119
|
-
return __getLinks(isExternal, releaseBranch, mainBaseURL, _channels.channelPathnames);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
106
|
function getLogoutLink() {
|
|
123
107
|
var releaseBranch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultReleaseBranch;
|
|
124
108
|
return {
|
|
@@ -153,35 +137,45 @@ function getLogoLink() {
|
|
|
153
137
|
return __getLink(isExternal, releaseBranch, mainBaseURL, '');
|
|
154
138
|
}
|
|
155
139
|
|
|
156
|
-
function
|
|
140
|
+
function getActionLinks() {
|
|
157
141
|
var _ref;
|
|
158
142
|
|
|
143
|
+
return _ref = {}, _defineProperty(_ref, _actions.ACTION_KEY.support, __composeExternalLink(__getExternalLinks().monthlyDonation)), _defineProperty(_ref, _actions.ACTION_KEY.newsLetter, __composeExternalLink(__getExternalLinks().newsLetter)), _ref;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function getFooterLinks() {
|
|
147
|
+
var _ref2;
|
|
148
|
+
|
|
159
149
|
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
160
150
|
var releaseBranch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultReleaseBranch;
|
|
161
|
-
return
|
|
151
|
+
return _ref2 = {}, _defineProperty(_ref2, _footer.FOOTER_KEY.aboutUs, __getLink(isExternal, releaseBranch, mainBaseURL, _footer.FOOTER_PATH[_footer.FOOTER_KEY.aboutUs])), _defineProperty(_ref2, _footer.FOOTER_KEY.influenceReport, __getLink(isExternal, releaseBranch, mainBaseURL, _footer.FOOTER_PATH[_footer.FOOTER_KEY.influenceReport])), _defineProperty(_ref2, _footer.FOOTER_KEY.openLab, __composeExternalLink(__getExternalLinks().openLab, '_blank')), _ref2;
|
|
162
152
|
}
|
|
163
153
|
|
|
164
|
-
function
|
|
165
|
-
var
|
|
154
|
+
function getSocialMediaLinks() {
|
|
155
|
+
var externalLinks = __getExternalLinks();
|
|
166
156
|
|
|
167
|
-
return
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
157
|
+
return _.reduce(_socialMedia.SOCIAL_MEDIA_KEY, function (res, key) {
|
|
158
|
+
var link = externalLinks[key];
|
|
159
|
+
|
|
160
|
+
if (link) {
|
|
161
|
+
res[key] = __composeExternalLink(link, '_blank');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return res;
|
|
165
|
+
}, {});
|
|
174
166
|
}
|
|
175
167
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
168
|
+
function getChannelLinks() {
|
|
169
|
+
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
170
|
+
var releaseBranch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultReleaseBranch;
|
|
171
|
+
|
|
172
|
+
var links = _.reduce(_channels.CHANNEL_PATH, function (res, path, key) {
|
|
173
|
+
var link = __getLink(isExternal, releaseBranch, mainBaseURL, path);
|
|
174
|
+
|
|
175
|
+
res[key] = link;
|
|
176
|
+
return res;
|
|
177
|
+
}, {});
|
|
178
|
+
|
|
179
|
+
links[_channels.CHANNEL_KEY.kidsReporter] = __composeExternalLink(__getExternalLinks().kidsReporter, '_blank');
|
|
180
|
+
return links;
|
|
181
|
+
}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _colors = _interopRequireDefault(require("../constants/colors"));
|
|
9
|
+
|
|
10
|
+
var _theme = _interopRequireDefault(require("../constants/theme"));
|
|
11
|
+
|
|
12
|
+
var _icon = require("./icon");
|
|
13
|
+
|
|
14
|
+
var _color = require("@twreporter/core/lib/constants/color");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
|
|
18
|
+
function selectLogoType(theme) {
|
|
19
|
+
switch (theme) {
|
|
20
|
+
case _theme["default"].photography:
|
|
21
|
+
case _theme["default"].transparent:
|
|
22
|
+
{
|
|
23
|
+
return 'white';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
default:
|
|
27
|
+
{
|
|
28
|
+
return 'default';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function selectServiceIcons(theme) {
|
|
34
|
+
switch (theme) {
|
|
35
|
+
case _theme["default"].photography:
|
|
36
|
+
{
|
|
37
|
+
return _icon.ServiceIcons.photography;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
case _theme["default"].transparent:
|
|
41
|
+
{
|
|
42
|
+
return _icon.ServiceIcons.transparent;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
case _theme["default"].index:
|
|
46
|
+
case _theme["default"].normal:
|
|
47
|
+
default:
|
|
48
|
+
{
|
|
49
|
+
return _icon.ServiceIcons.normal;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function selectHamburgerServiceIcons(theme) {
|
|
55
|
+
switch (theme) {
|
|
56
|
+
case _theme["default"].photography:
|
|
57
|
+
{
|
|
58
|
+
return _icon.ServiceIcons.photography;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
case _theme["default"].transparent:
|
|
62
|
+
case _theme["default"].index:
|
|
63
|
+
case _theme["default"].normal:
|
|
64
|
+
default:
|
|
65
|
+
{
|
|
66
|
+
return _icon.ServiceIcons.normal;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function selectIcons(theme) {
|
|
72
|
+
switch (theme) {
|
|
73
|
+
case _theme["default"].photography:
|
|
74
|
+
{
|
|
75
|
+
return _icon.Icons.photography;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
case _theme["default"].transparent:
|
|
79
|
+
{
|
|
80
|
+
return _icon.Icons.transparent;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
case _theme["default"].index:
|
|
84
|
+
case _theme["default"].normal:
|
|
85
|
+
default:
|
|
86
|
+
{
|
|
87
|
+
return _icon.Icons.normal;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function selectChannelTheme(theme) {
|
|
93
|
+
switch (theme) {
|
|
94
|
+
case _theme["default"].photography:
|
|
95
|
+
{
|
|
96
|
+
return {
|
|
97
|
+
bgColor: _color.colorPhoto.dark,
|
|
98
|
+
fontColor: _color.colorGrayscale.gray600,
|
|
99
|
+
hoverFontColor: _color.colorGrayscale.white,
|
|
100
|
+
hoverBgColor: _colors["default"].gray50,
|
|
101
|
+
borderColor: _colors["default"].gray250
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
case _theme["default"].transparent:
|
|
106
|
+
{
|
|
107
|
+
return {
|
|
108
|
+
bgColor: 'transparent',
|
|
109
|
+
fontColor: _color.colorGrayscale.white,
|
|
110
|
+
hoverFontColor: _color.colorGrayscale.gray900,
|
|
111
|
+
hoverBgColor: _color.colorGrayscale.white,
|
|
112
|
+
borderColor: _colors["default"].gray250
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
case _theme["default"].index:
|
|
117
|
+
{
|
|
118
|
+
return {
|
|
119
|
+
bgColor: _color.colorGrayscale.white,
|
|
120
|
+
fontColor: _color.colorGrayscale.gray600,
|
|
121
|
+
hoverFontColor: _color.colorGrayscale.gray900,
|
|
122
|
+
hoverBgColor: _colors["default"].gray150,
|
|
123
|
+
borderColor: _color.colorGrayscale.gray200
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
case _theme["default"].normal:
|
|
128
|
+
default:
|
|
129
|
+
{
|
|
130
|
+
return {
|
|
131
|
+
bgColor: _color.colorGrayscale.gray100,
|
|
132
|
+
fontColor: _color.colorGrayscale.gray600,
|
|
133
|
+
hoverFontColor: _color.colorGrayscale.gray900,
|
|
134
|
+
hoverBgColor: _colors["default"].gray150,
|
|
135
|
+
borderColor: _color.colorGrayscale.gray200
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function selectHeaderTheme(theme) {
|
|
142
|
+
switch (theme) {
|
|
143
|
+
case _theme["default"].photography:
|
|
144
|
+
{
|
|
145
|
+
return {
|
|
146
|
+
bgColor: _color.colorPhoto.dark,
|
|
147
|
+
borderColor: _colors["default"].gray250
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
case _theme["default"].transparent:
|
|
152
|
+
{
|
|
153
|
+
return {
|
|
154
|
+
bgColor: _colors["default"].gray150,
|
|
155
|
+
borderColor: _colors["default"].gray250
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
case _theme["default"].index:
|
|
160
|
+
{
|
|
161
|
+
return {
|
|
162
|
+
bgColor: _color.colorGrayscale.white,
|
|
163
|
+
borderColor: _color.colorGrayscale.gray200
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
case _theme["default"].normal:
|
|
168
|
+
default:
|
|
169
|
+
{
|
|
170
|
+
return {
|
|
171
|
+
bgColor: _color.colorGrayscale.gray100,
|
|
172
|
+
borderColor: _color.colorGrayscale.gray200
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function selectActionButtonTheme(theme) {
|
|
179
|
+
switch (theme) {
|
|
180
|
+
case _theme["default"].photography:
|
|
181
|
+
{
|
|
182
|
+
return {
|
|
183
|
+
color: _color.colorGrayscale.white,
|
|
184
|
+
bgColor: _color.colorSupportive.main,
|
|
185
|
+
hoverBgColor: _colors["default"].brownDark
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
case _theme["default"].transparent:
|
|
190
|
+
{
|
|
191
|
+
return {
|
|
192
|
+
color: _color.colorSupportive.main,
|
|
193
|
+
bgColor: _color.colorGrayscale.white,
|
|
194
|
+
hoverBgColor: _color.colorGrayscale.gray300
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
case _theme["default"].index:
|
|
199
|
+
case _theme["default"].normal:
|
|
200
|
+
default:
|
|
201
|
+
{
|
|
202
|
+
return {
|
|
203
|
+
color: _color.colorGrayscale.white,
|
|
204
|
+
bgColor: _color.colorBrand.heavy,
|
|
205
|
+
hoverBgColor: _colors["default"].redDark
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function selectHamburgerMenuTheme(theme) {
|
|
212
|
+
switch (theme) {
|
|
213
|
+
case _theme["default"].photography:
|
|
214
|
+
{
|
|
215
|
+
return {
|
|
216
|
+
bgColor: _color.colorPhoto.dark
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
case _theme["default"].transparent:
|
|
221
|
+
case _theme["default"].index:
|
|
222
|
+
case _theme["default"].normal:
|
|
223
|
+
default:
|
|
224
|
+
{
|
|
225
|
+
return {
|
|
226
|
+
bgColor: _color.colorGrayscale.gray100
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function selectHamburgerServiceTheme(theme) {
|
|
233
|
+
switch (theme) {
|
|
234
|
+
case _theme["default"].photography:
|
|
235
|
+
{
|
|
236
|
+
return {
|
|
237
|
+
borderColor: _colors["default"].gray450
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
case _theme["default"].transparent:
|
|
242
|
+
case _theme["default"].index:
|
|
243
|
+
case _theme["default"].normal:
|
|
244
|
+
default:
|
|
245
|
+
{
|
|
246
|
+
return {
|
|
247
|
+
borderColor: _colors["default"].gray250
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function selectSloganTheme(theme) {
|
|
254
|
+
switch (theme) {
|
|
255
|
+
case _theme["default"].photography:
|
|
256
|
+
{
|
|
257
|
+
return _color.colorSupportive.main;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
case _theme["default"].transparent:
|
|
261
|
+
{
|
|
262
|
+
return _color.colorGrayscale.white;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
case _theme["default"].index:
|
|
266
|
+
case _theme["default"].normal:
|
|
267
|
+
default:
|
|
268
|
+
{
|
|
269
|
+
return _color.colorGrayscale.gray900;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/*
|
|
274
|
+
* HB is the abbreviation of hamburger.
|
|
275
|
+
* The HB series of theme functions are used in hamburger menu.
|
|
276
|
+
*/
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
function selectActionButtonHBTheme(theme) {
|
|
280
|
+
switch (theme) {
|
|
281
|
+
case _theme["default"].transparent:
|
|
282
|
+
{
|
|
283
|
+
return selectActionButtonTheme('normal');
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
case _theme["default"].photography:
|
|
287
|
+
case _theme["default"].index:
|
|
288
|
+
case _theme["default"].normal:
|
|
289
|
+
default:
|
|
290
|
+
{
|
|
291
|
+
return selectActionButtonTheme(theme);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function selectChannelHBTheme(theme) {
|
|
297
|
+
switch (theme) {
|
|
298
|
+
case _theme["default"].transparent:
|
|
299
|
+
{
|
|
300
|
+
return selectChannelTheme('normal');
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
case _theme["default"].photography:
|
|
304
|
+
case _theme["default"].index:
|
|
305
|
+
case _theme["default"].normal:
|
|
306
|
+
default:
|
|
307
|
+
{
|
|
308
|
+
return selectChannelTheme(theme);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function selectSloganHBTheme(theme) {
|
|
314
|
+
switch (theme) {
|
|
315
|
+
case _theme["default"].transparent:
|
|
316
|
+
{
|
|
317
|
+
return selectSloganTheme('normal');
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
case _theme["default"].photography:
|
|
321
|
+
case _theme["default"].index:
|
|
322
|
+
case _theme["default"].normal:
|
|
323
|
+
default:
|
|
324
|
+
{
|
|
325
|
+
return selectSloganTheme(theme);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
var _default = {
|
|
331
|
+
selectLogoType: selectLogoType,
|
|
332
|
+
selectServiceIcons: selectServiceIcons,
|
|
333
|
+
selectHamburgerServiceIcons: selectHamburgerServiceIcons,
|
|
334
|
+
selectIcons: selectIcons,
|
|
335
|
+
selectHeaderTheme: selectHeaderTheme,
|
|
336
|
+
selectChannelTheme: selectChannelTheme,
|
|
337
|
+
selectActionButtonTheme: selectActionButtonTheme,
|
|
338
|
+
selectSloganTheme: selectSloganTheme,
|
|
339
|
+
selectChannelHBTheme: selectChannelHBTheme,
|
|
340
|
+
selectActionButtonHBTheme: selectActionButtonHBTheme,
|
|
341
|
+
selectSloganHBTheme: selectSloganHBTheme,
|
|
342
|
+
selectHamburgerMenuTheme: selectHamburgerMenuTheme,
|
|
343
|
+
selectHamburgerServiceTheme: selectHamburgerServiceTheme
|
|
344
|
+
};
|
|
345
|
+
exports["default"] = _default;
|