@redocly/theme 0.9.5 → 0.9.6
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.
|
@@ -8,6 +8,5 @@ export interface UserProfileProps {
|
|
|
8
8
|
};
|
|
9
9
|
handleLogout: (logoutRedirect?: string) => void;
|
|
10
10
|
hasDeveloperOnboarding?: boolean;
|
|
11
|
-
hasApiLogs?: boolean;
|
|
12
11
|
}
|
|
13
|
-
export declare function UserProfile({ userInfo, handleLogout, hasDeveloperOnboarding,
|
|
12
|
+
export declare function UserProfile({ userInfo, handleLogout, hasDeveloperOnboarding, }: UserProfileProps): JSX.Element;
|
|
@@ -33,15 +33,13 @@ const Link_1 = require("../mocks/Link");
|
|
|
33
33
|
const Profile_1 = require("../Profile/Profile");
|
|
34
34
|
const Tooltip_1 = require("../Tooltip/Tooltip");
|
|
35
35
|
const useThemeConfig_1 = require("../hooks/useThemeConfig");
|
|
36
|
-
function UserProfile({ userInfo, handleLogout, hasDeveloperOnboarding = false,
|
|
36
|
+
function UserProfile({ userInfo, handleLogout, hasDeveloperOnboarding = false, }) {
|
|
37
37
|
const [isOpened, setIsOpened] = (0, react_1.useState)(false);
|
|
38
38
|
const { userProfile: userProfileSettings } = (0, useThemeConfig_1.useThemeConfig)();
|
|
39
39
|
const logoutRedirect = (userProfileSettings === null || userProfileSettings === void 0 ? void 0 : userProfileSettings.logoutRedirect) || '/';
|
|
40
|
-
return (react_1.default.createElement(StyledTooltip, { isOpen: isOpened, withArrow: false, className: "copy-button", placement: "bottom", width: "100%", tip: react_1.default.createElement(StyledUl,
|
|
40
|
+
return (react_1.default.createElement(StyledTooltip, { isOpen: isOpened, withArrow: false, className: "copy-button", placement: "bottom", width: "100%", tip: react_1.default.createElement(StyledUl, { onClick: () => setIsOpened(false) },
|
|
41
41
|
hasDeveloperOnboarding ? (react_1.default.createElement(Link_1.Link, { to: "/apps" },
|
|
42
42
|
react_1.default.createElement(StyledLi, null, "My Apps"))) : null,
|
|
43
|
-
hasApiLogs ? (react_1.default.createElement(Link_1.Link, { to: "/api-logs" },
|
|
44
|
-
react_1.default.createElement(StyledLi, null, "API logs"))) : null,
|
|
45
43
|
react_1.default.createElement(StyledLi, { onClick: () => handleLogout(logoutRedirect) }, (userProfileSettings === null || userProfileSettings === void 0 ? void 0 : userProfileSettings.logoutLabel) || 'Log out')) },
|
|
46
44
|
react_1.default.createElement(Profile_1.Profile, { name: userInfo.name, imageUrl: userInfo.picture, onClick: userInfo.logoutDisabled ? undefined : () => setIsOpened(!isOpened) })));
|
|
47
45
|
}
|
package/lib/globalStyle.js
CHANGED
|
@@ -1892,9 +1892,6 @@ const tile = (0, styled_components_1.css) `
|
|
|
1892
1892
|
--wide-tile-background-color: var(--color-secondary-100);
|
|
1893
1893
|
--thin-tile-background-color: var(--color-secondary-100);
|
|
1894
1894
|
`;
|
|
1895
|
-
const apiLogsTable = (0, styled_components_1.css) `
|
|
1896
|
-
--api-logs-row-hover-background-color: var(--color-secondary-300);
|
|
1897
|
-
`;
|
|
1898
1895
|
const pages = (0, styled_components_1.css) `
|
|
1899
1896
|
/**
|
|
1900
1897
|
* @tokens 404 Page
|
|
@@ -1979,7 +1976,6 @@ exports.styles = (0, styled_components_1.css) `
|
|
|
1979
1976
|
${lastUpdated}
|
|
1980
1977
|
${tile}
|
|
1981
1978
|
${loadProgressBar}
|
|
1982
|
-
${apiLogsTable}
|
|
1983
1979
|
${pages}
|
|
1984
1980
|
${modal}
|
|
1985
1981
|
|
package/package.json
CHANGED
|
@@ -15,14 +15,12 @@ export interface UserProfileProps {
|
|
|
15
15
|
};
|
|
16
16
|
handleLogout: (logoutRedirect?: string) => void;
|
|
17
17
|
hasDeveloperOnboarding?: boolean;
|
|
18
|
-
hasApiLogs?: boolean;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
export function UserProfile({
|
|
22
21
|
userInfo,
|
|
23
22
|
handleLogout,
|
|
24
23
|
hasDeveloperOnboarding = false,
|
|
25
|
-
hasApiLogs = false,
|
|
26
24
|
}: UserProfileProps): JSX.Element {
|
|
27
25
|
const [isOpened, setIsOpened] = useState<boolean>(false);
|
|
28
26
|
|
|
@@ -38,17 +36,12 @@ export function UserProfile({
|
|
|
38
36
|
placement="bottom"
|
|
39
37
|
width="100%"
|
|
40
38
|
tip={
|
|
41
|
-
<StyledUl>
|
|
39
|
+
<StyledUl onClick={() => setIsOpened(false)}>
|
|
42
40
|
{hasDeveloperOnboarding ? (
|
|
43
41
|
<Link to="/apps">
|
|
44
42
|
<StyledLi>My Apps</StyledLi>
|
|
45
43
|
</Link>
|
|
46
44
|
) : null}
|
|
47
|
-
{hasApiLogs ? (
|
|
48
|
-
<Link to="/api-logs">
|
|
49
|
-
<StyledLi>API logs</StyledLi>
|
|
50
|
-
</Link>
|
|
51
|
-
) : null}
|
|
52
45
|
<StyledLi onClick={() => handleLogout(logoutRedirect)}>
|
|
53
46
|
{userProfileSettings?.logoutLabel || 'Log out'}
|
|
54
47
|
</StyledLi>
|
package/src/globalStyle.ts
CHANGED
|
@@ -1917,10 +1917,6 @@ const tile = css`
|
|
|
1917
1917
|
--thin-tile-background-color: var(--color-secondary-100);
|
|
1918
1918
|
`;
|
|
1919
1919
|
|
|
1920
|
-
const apiLogsTable = css`
|
|
1921
|
-
--api-logs-row-hover-background-color: var(--color-secondary-300);
|
|
1922
|
-
`
|
|
1923
|
-
|
|
1924
1920
|
const pages = css`
|
|
1925
1921
|
/**
|
|
1926
1922
|
* @tokens 404 Page
|
|
@@ -2007,7 +2003,6 @@ export const styles = css`
|
|
|
2007
2003
|
${lastUpdated}
|
|
2008
2004
|
${tile}
|
|
2009
2005
|
${loadProgressBar}
|
|
2010
|
-
${apiLogsTable}
|
|
2011
2006
|
${pages}
|
|
2012
2007
|
${modal}
|
|
2013
2008
|
|