From 8b0e2455925fd54261dba9f3006acf36e5b9be95 Mon Sep 17 00:00:00 2001 From: Jennifer Byrne Date: Wed, 10 Jul 2024 01:02:41 -0500 Subject: [PATCH] fix channel card styles --- .../publishers/home/channels/ChannelCard.tsx | 17 +++++++++-------- .../home/channels/CryptoWalletOption.jsx | 2 +- nextjs/src/lib/api.ts | 5 +++-- nextjs/src/messages/en.json | 5 +++-- nextjs/src/styles/ChannelCard.module.css | 15 ++++++++++++--- 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/nextjs/src/app/[locale]/publishers/home/channels/ChannelCard.tsx b/nextjs/src/app/[locale]/publishers/home/channels/ChannelCard.tsx index b926e26fd..7942f828c 100644 --- a/nextjs/src/app/[locale]/publishers/home/channels/ChannelCard.tsx +++ b/nextjs/src/app/[locale]/publishers/home/channels/ChannelCard.tsx @@ -9,6 +9,7 @@ import { useContext,useEffect,useState } from 'react'; import { apiRequest } from '@/lib/api'; import Card from '@/components/Card'; +import styles from '@/styles/ChannelCard.module.css'; import ChannelCryptoEditor from './ChannelCryptoEditor'; @@ -36,11 +37,11 @@ export default function ChannelCard({ channel, publisherPayable, onChannelDelete function channelIconType() { if (channelType() === 'site') { - return ; + return ; } else if (channelType() === 'twitter') { - return ; + return ; } else { - return ; + return ; } } @@ -49,12 +50,12 @@ export default function ChannelCard({ channel, publisherPayable, onChannelDelete } function displayVerified() { - if (channel.verified && publisherPayable) { + if (channel.verified) { return (
- {t('Home.channels.verified')} + {t('Home.channels.verified')} - +
); @@ -65,7 +66,7 @@ export default function ChannelCard({ channel, publisherPayable, onChannelDelete
{t('Home.channels.not_verified')} - +
); @@ -93,7 +94,7 @@ export default function ChannelCard({ channel, publisherPayable, onChannelDelete )}
-
+
diff --git a/nextjs/src/app/[locale]/publishers/home/channels/CryptoWalletOption.jsx b/nextjs/src/app/[locale]/publishers/home/channels/CryptoWalletOption.jsx index f49a5fb77..90c7bb1db 100644 --- a/nextjs/src/app/[locale]/publishers/home/channels/CryptoWalletOption.jsx +++ b/nextjs/src/app/[locale]/publishers/home/channels/CryptoWalletOption.jsx @@ -40,7 +40,7 @@ export default function CryptoWalletOption({ {formatCryptoAddress(value.address)} - + diff --git a/nextjs/src/lib/api.ts b/nextjs/src/lib/api.ts index a9968227b..b8679cdc5 100644 --- a/nextjs/src/lib/api.ts +++ b/nextjs/src/lib/api.ts @@ -16,11 +16,12 @@ export async function apiRequest( const response = await axios({ method, url, data }); return response.data; } catch (err) { - console.log(err) // all response codes that aren't 200s or 300s get sent here // Imperatively navigate to Unauthorized page on 403 - if (err.response.status === 403 || err.response.status === 422) { + if (err.response && err.response.status === 403 || err.response.status === 422) { window.location.replace('/log-in'); + } else { + console.log(err); } return { errors: [err] }; diff --git a/nextjs/src/messages/en.json b/nextjs/src/messages/en.json index 32d6e945d..9577f435a 100644 --- a/nextjs/src/messages/en.json +++ b/nextjs/src/messages/en.json @@ -50,7 +50,8 @@ "reddit": "Reddit", "vimeo": "Vimeo", "youtube": "Youtube", - "twitch": "Twitch" + "twitch": "Twitch", + "github": "Github" } }, "activerecord": { @@ -124,7 +125,7 @@ "add_channel_title": "What are channels?" }, "addCryptoWidget": { - "addWallet": "Add new crypto address", + "addWallet": "Add new address", "clearWallet": "Clear address", "solanaConnectError": "Connect a Solana wallet to add an address", "ethereumConnectError": "Connect an Ethereum wallet to add an address", diff --git a/nextjs/src/styles/ChannelCard.module.css b/nextjs/src/styles/ChannelCard.module.css index 7d6e9db19..26854c11f 100644 --- a/nextjs/src/styles/ChannelCard.module.css +++ b/nextjs/src/styles/ChannelCard.module.css @@ -8,11 +8,12 @@ .crypto-wallet-dropdown { border: 1px solid rgba(199 199 204 100%); + padding: 3px; padding-left: 30px; border-radius: 8px; background-repeat: no-repeat; - background-position: bottom 10px left 10px; - background-size: 6.5%; + background-position: bottom 10px left 6px; + background-size: 5.5%; } .crypto-wallet-dropdown-eth { @@ -44,7 +45,7 @@ text-align: center; padding: 10px; padding-top: 15px; - color: #423EEE; + color: var(--leo-color-text-tertiary); font-weight: bold; font-size: 0.9em; cursor: pointer; @@ -58,6 +59,14 @@ } } +.channel-card-icon { + --leo-icon-width: 18px; +} + +.channel-verification-icon { + --leo-icon-width: 20px; +} + .privacy-header { font-family: var(--font-poppins); font-size: 28px;