Skip to content

Commit

Permalink
Add return label to studio link
Browse files Browse the repository at this point in the history
  • Loading branch information
owi92 committed Sep 11, 2023
1 parent 694f1f7 commit e3a0ba6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion frontend/src/layout/header/UserBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ const LoggedIn: React.FC<LoggedInProps> = ({ user }) => {
icon: <FiVideo />,
wrapper: <ExternalLink
service="STUDIO"
params={{ "return.target": new URL(document.location.href) }}
params={{
"return.target": new URL(document.location.href),
"return.label": "Tobira",
}}
fallback="link"
/>,
keepOpenAfterClick: true,
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/relay/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type ExternalLinkProps = PropsWithChildren<{
service: "STUDIO";
params: {
"return.target": URL;
"return.label": string;
};
} | {
service: "EDITOR";
Expand All @@ -49,7 +50,7 @@ export const ExternalLink: React.FC<ExternalLinkProps> = ({
}) => {
const target = serviceUrl(service);
for (const [key, value] of Object.entries(params)) {
target.searchParams.append(key, value);
target.searchParams.append(key, value as string);
}

if (!CONFIG.auth.preAuthExternalLinks) {
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/routes/manage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ export const ManageNav: React.FC<ManageNavProps> = ({ active }) => {
items.push(
<ExternalLink
service="STUDIO"
params={{ "return.target": new URL(document.location.href) }}
params={{
"return.target": new URL(document.location.href),
"return.label": "Tobira",
}}
fallback="link"
css={{
backgroundColor: "inherit",
Expand Down

0 comments on commit e3a0ba6

Please sign in to comment.