From 5130f52f612aaedf22666aadf4cb06239e30b167 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 25 Dec 2022 22:15:41 -0800 Subject: [PATCH] Use Link on GridRep * Open grids in new tab * Can favorite or open grid still * Can now navigate to profile from grid collection --- components/GridRep/index.scss | 4 ++ components/GridRep/index.tsx | 90 ++++++++++++++++++++++------------- styles/themes.scss | 4 ++ styles/variables.scss | 3 ++ 4 files changed, 67 insertions(+), 34 deletions(-) diff --git a/components/GridRep/index.scss b/components/GridRep/index.scss index a47aa2fa..27717f65 100644 --- a/components/GridRep/index.scss +++ b/components/GridRep/index.scss @@ -99,6 +99,10 @@ .bottom { display: flex; flex-direction: row; + + a.user:hover { + color: var(--link-text-hover); + } } .raid, diff --git a/components/GridRep/index.tsx b/components/GridRep/index.tsx index f353a8ed..41180b6a 100644 --- a/components/GridRep/index.tsx +++ b/components/GridRep/index.tsx @@ -1,4 +1,5 @@ import React, { useEffect, useState } from 'react' +import Link from 'next/link' import { useRouter } from 'next/router' import { useSnapshot } from 'valtio' import { useTranslation } from 'next-i18next' @@ -132,11 +133,28 @@ const GridRep = (props: Props) => { } else return
} + const linkedAttribution = () => ( + + + {userImage()} + {props.user ? props.user.username : t('no_user')} + + + ) + + const unlinkedAttribution = () => ( +
+ {userImage()} + {props.user ? props.user.username : t('no_user')} +
+ ) + const details = (
-

- {props.name ? props.name : t('no_title')} -

+

{props.name ? props.name : t('no_title')}

{props.raid ? props.raid.name[locale] : t('no_raid')} @@ -152,7 +170,7 @@ const GridRep = (props: Props) => {
-

+

{props.name ? props.name : t('no_title')}

@@ -162,23 +180,25 @@ const GridRep = (props: Props) => { {account.authorized && ((props.user && account.user && account.user.id !== props.user.id) || !props.user) ? ( -
-
- {userImage()} - {props.user ? props.user.username : t('no_user')} -
+ {props.user ? linkedAttribution() : unlinkedAttribution()} + @@ -187,25 +207,27 @@ const GridRep = (props: Props) => { ) return ( - + + ) } diff --git a/styles/themes.scss b/styles/themes.scss index 4871bb75..acc5dfd8 100644 --- a/styles/themes.scss +++ b/styles/themes.scss @@ -7,6 +7,8 @@ --card-bg: #{$grey-100}; --bar-bg: #{$grey-100}; + --link-text-hover: #{$text--link--hover--light}; + // Light - Menus --dialog-bg: #{$dialog--bg--light}; @@ -120,6 +122,8 @@ --card-bg: #{$page--element--bg--dark}; --bar-bg: #{$grey-10}; + --link-text-hover: #{$text--link--hover--dark}; + // Dark - Dialogs --dialog-bg: #{$dialog--bg--dark}; diff --git a/styles/variables.scss b/styles/variables.scss index f0bec0fe..94a22bdc 100644 --- a/styles/variables.scss +++ b/styles/variables.scss @@ -235,6 +235,9 @@ $text--tertiary--color--dark: $grey-50; $text--tertiary--hover--light: $grey-40; $text--tertiary--hover--dark: $grey-70; +$text--link--hover--light: $grey-40; +$text--link--hover--dark: $grey-100; + // Color Definitions: Icon $icon--secondary--color--light: $grey-70; $icon--secondary--color--dark: $grey-50;