-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from stellar/release/3.3.0
Release `3.3.0` to `main`
- Loading branch information
Showing
13 changed files
with
125 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,39 @@ | ||
import React from "react"; | ||
import { Link, Notification } from "@stellar/design-system"; | ||
import "./styles.scss"; | ||
|
||
interface NotificationWithButtonsProps { | ||
variant: "primary" | "secondary" | "success" | "error" | "warning"; | ||
title: string; | ||
icon?: React.ReactNode; | ||
buttons: { | ||
buttons?: { | ||
label: string; | ||
onClick: () => void; | ||
}[]; | ||
children: string | React.ReactNode; | ||
} | ||
|
||
export const NotificationWithButtons: React.FC< | ||
export const NotificationWithButtons = React.forwardRef< | ||
HTMLDivElement, | ||
NotificationWithButtonsProps | ||
> = ({ | ||
variant, | ||
title, | ||
icon, | ||
buttons, | ||
children, | ||
}: NotificationWithButtonsProps) => { | ||
>(({ variant, title, icon, buttons, children }, ref) => { | ||
return ( | ||
<Notification variant={variant} title={title} icon={icon}> | ||
<div>{children}</div> | ||
<div ref={ref} className="NotificationWithButtons__wrapper"> | ||
<Notification variant={variant} title={title} icon={icon}> | ||
<div>{children}</div> | ||
|
||
<div className="Notification__buttons"> | ||
{buttons.map((b) => ( | ||
<Link role="button" onClick={b.onClick} key={`btn-${b.label}`}> | ||
{b.label} | ||
</Link> | ||
))} | ||
</div> | ||
</Notification> | ||
{buttons && ( | ||
<div className="Notification__buttons"> | ||
{buttons.map((b) => ( | ||
<Link role="button" onClick={b.onClick} key={`btn-${b.label}`}> | ||
{b.label} | ||
</Link> | ||
))} | ||
</div> | ||
)} | ||
</Notification> | ||
</div> | ||
); | ||
}; | ||
}); | ||
|
||
NotificationWithButtons.displayName = "NotificationWithButtons"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
export const getSdpTenantName = (organizationName?: string): string => | ||
organizationName ?? window.location.hostname.split(".")[0]; | ||
import { DISABLE_TENANT_PREFIL_FROM_DOMAIN } from "constants/envVariables"; | ||
import { localStorageTenantName } from "helpers/localStorageTenantName"; | ||
|
||
export const getSdpTenantName = (organizationName?: string): string => { | ||
const orgName = organizationName || localStorageTenantName.get(); | ||
|
||
if (DISABLE_TENANT_PREFIL_FROM_DOMAIN === "true") { | ||
return orgName || ""; | ||
} | ||
|
||
return orgName || window.location.hostname.split(".")[0]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { LOCAL_STORAGE_TENANT_NAME } from "constants/settings"; | ||
|
||
export const localStorageTenantName = { | ||
get: () => { | ||
return localStorage.getItem(LOCAL_STORAGE_TENANT_NAME); | ||
}, | ||
set: (token: string) => { | ||
return localStorage.setItem(LOCAL_STORAGE_TENANT_NAME, token); | ||
}, | ||
remove: () => { | ||
return localStorage.removeItem(LOCAL_STORAGE_TENANT_NAME); | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.