diff --git a/src/components/general/Icon/ArrowRightTopIcon.tsx b/src/components/general/Icon/ArrowRightTopIcon.tsx index 87952782..d1301067 100644 --- a/src/components/general/Icon/ArrowRightTopIcon.tsx +++ b/src/components/general/Icon/ArrowRightTopIcon.tsx @@ -2,35 +2,13 @@ import React from 'react' const ArrowRightTopIcon: React.FC> = props => { return ( - - - - - - - - - - + + ) } diff --git a/src/components/notifications/AppExplorer/AppCard/index.tsx b/src/components/notifications/AppExplorer/AppCard/index.tsx index 6e97def5..e143b11a 100644 --- a/src/components/notifications/AppExplorer/AppCard/index.tsx +++ b/src/components/notifications/AppExplorer/AppCard/index.tsx @@ -40,6 +40,7 @@ const AppCard: React.FC = ({ const { activeSubscriptions } = useContext(W3iContext) const host = new URL(url).host + const projectURL = new URL(url) useEffect(() => { // If the account changes, the subscribing flow has broken. @@ -49,8 +50,6 @@ const AppCard: React.FC = ({ const subscribed = userPubkey && activeSubscriptions.some(element => { - const projectURL = new URL(url) - return projectURL.hostname === element.metadata.appDomain }) const logoURL = logo || '/fallback.svg' diff --git a/src/components/notifications/AppNotifications/AppNotifications.scss b/src/components/notifications/AppNotifications/AppNotifications.scss index d57ed28a..99439c54 100644 --- a/src/components/notifications/AppNotifications/AppNotifications.scss +++ b/src/components/notifications/AppNotifications/AppNotifications.scss @@ -199,6 +199,7 @@ color: var(--accent-color-1); display: none; align-items: center; + gap: 0.125rem; span { color: var(--accent-color-1); @@ -214,7 +215,7 @@ color: var(--fg-color-1); display: flex; align-items: center; - gap: 2px; + gap: 0.125rem; &__external-link-icon { display: inline-block; diff --git a/src/components/notifications/AppNotifications/AppNotificationsHeader/AppNotificationsHeader.scss b/src/components/notifications/AppNotifications/AppNotificationsHeader/AppNotificationsHeader.scss index c41f081f..1ed6dc09 100644 --- a/src/components/notifications/AppNotifications/AppNotificationsHeader/AppNotificationsHeader.scss +++ b/src/components/notifications/AppNotifications/AppNotificationsHeader/AppNotificationsHeader.scss @@ -77,13 +77,22 @@ -webkit-box-orient: vertical; -webkit-line-clamp: 1; } - &__description { + &__link { color: var(--fg-color-2); - + text-decoration: none; + display: flex; + align-items: center; overflow: hidden; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 1; + gap: 0.125rem; + + svg { + display: inline-block; + } + + &:hover { + color: var(--fg-color-2); + filter: brightness(0.9); + } } } &__actions { diff --git a/src/components/notifications/AppNotifications/AppNotificationsHeader/index.tsx b/src/components/notifications/AppNotifications/AppNotificationsHeader/index.tsx index 4d10a5ce..8a68c2a2 100644 --- a/src/components/notifications/AppNotifications/AppNotificationsHeader/index.tsx +++ b/src/components/notifications/AppNotifications/AppNotificationsHeader/index.tsx @@ -1,11 +1,15 @@ -import { useContext, useState } from 'react' +import { useContext } from 'react' + +import { Link } from 'react-router-dom' import BackButton from '@/components/general/BackButton' import Button from '@/components/general/Button' +import ArrowRightTopIcon from '@/components/general/Icon/ArrowRightTopIcon' import Text from '@/components/general/Text' import W3iContext from '@/contexts/W3iContext/context' import { noop } from '@/utils/general' import { useIsMobile } from '@/utils/hooks' +import getDomainHref from '@/utils/url' import AppNotificationDropdown from '../AppNotificationDropdown' @@ -17,6 +21,7 @@ interface IAppNotificationsHeaderProps { name: string domain: string } + const AppNotificationsHeader: React.FC = ({ domain, logo, @@ -25,7 +30,7 @@ const AppNotificationsHeader: React.FC = ({ }) => { const isMobile = useIsMobile() const { dappOrigin } = useContext(W3iContext) - const [dropdownToShow, setDropdownToShow] = useState() + const href = getDomainHref(domain) return (
@@ -53,18 +58,26 @@ const AppNotificationsHeader: React.FC = ({ />

{name}

- - {domain} - + + {domain} +
+ +
+
setDropdownToShow(undefined)} h="2.5em" w="2.5em" notificationId={id} dropdownPlacement="bottomLeft" + closeDropdown={noop} />
diff --git a/src/utils/url.ts b/src/utils/url.ts new file mode 100644 index 00000000..5e5368f3 --- /dev/null +++ b/src/utils/url.ts @@ -0,0 +1,16 @@ +export const PROTOCOL = 'https://' + +/** + * Returns the full URL of the given domain + * @param domain + * @return Href value - string + */ +export default function getDomainHref(domain: string): string { + if (!domain) { + throw new Error('Domain is required') + } + + const url = new URL(PROTOCOL + domain) + + return url.href +}